Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

First Person Shooter Considerations

Discussion in 'Editor & General Support' started by drJones, Apr 9, 2006.

  1. drJones


    Oct 19, 2005
    I'm planning a FPS that has both a story mode a PVP mode. I've been fooling around with the soldier prefab have a two questions:

    -I've serched the net for a while now can't seem to find any standard info on how the basics work, i.e. in the player's view (in story mode) the weapon seems to be a premade movie not a physical model in the scene, is this correct can this be done in unity (by way of a gui texture i would imagine)? but in mutli-player modes there are actual 3d weapon models that you can see the other players holding. also, in some games when a character dies the camera switches to 3rd person view to show the ragdoll effect - was the 3d ragdoll instantiated at that point (with only the player capsule camera existing before) or was it always in the scene just not rendered to the player view? i'm sure developers may approach this differently, but does anyone have any general experience or info regarding this?

    -Unity specific: how does one go about level interaction (such as conveyor belts) with a kinematic model? i've already read these threads:

    but they seem to be based on the standard capsule-camera setup, not the animated model which would be neccessary for a 2-player game. i'd like to try work something out myself but i'm not sure what i need to start with to make it operate correctly.
  2. Aras


    Unity Technologies

    Nov 7, 2005
    In most FPSes the weapon is an actual 3D model (you can see that it's 3D by watching lighting interactions with it in most recent games). However, it is really treated in a bit special way. I guess the model is just weapon plus some hands (up to what can be seen from player's eyes); maybe it's tied (parented) to the camera as well.

    In network game, you just do it the same way for "me" player, and render regular full models for "other" players.

    Regarding switch to 3rd person - well, there is a zillion way of doing this. Probably the easiest one is always having the two representations, and just disabling one of them (e.g. disable renderer) according to situation.
  3. drJones


    Oct 19, 2005
    its funny i never noticed that (it's that way in the new farcry). thanks for the info.
  4. elias723


    Feb 10, 2006
    As a side topic to this, if I wanted to have my character holding a weapon instead of it hovering, what is the best way to do this in Unity? I have never used the animation on Unity before, but I think I could get the hang of it if you give me some advice. It just seems silly to have my weapons all hovering when my guy should be holding them. This is more important in a multiplayer game, as you have said, and that is what I am in the process of making. Any tips on this would be greatly appreciated.
  5. NicholasFrancis


    Apr 8, 2005
    We've done that in Intifada...

    Basically, we had a script on the weapon that would copy the position of a named bone to the weapon.

    In start() we find the bone to match against (hand) and store that in a transform... then we do

    Code (csharp):
    2. void LateUpdate () {
    3.    transform.position = hand.position;
    4.    transform.rotation = hand.rotation;
    5. }