moving gun in first person shooter while walking

Hi, Glacier Entertainment and Studios (c) here, well my studios and I are new to unity and are creating an FPSMMORPG, we have everything set up, but now we are getting more into the detailed area. When in first person view, I see my gun but it is completely static. This looks very ugly and I would like to fix/ change it. Another thing is reloading. When the gun reloads it just pauses fire for a few seconds and moves on, how would I create an animation for the hands/ gun to look as though I am reloading. I do plan on making profit on this game so I am taking this very seriously ( also I am taking my time with this project, I am still learning about Unity and it's components so dont criticize to badly!... please).

       Thankyou, 
      Codex1770c

http://dastardlybanana.com/FPSConstructorWeapons.htm

This si quite good

As you're apparently in First Person View you could do with creating a few bones for the player arm (if hand is visible give it a mesh as well), animate this arm, attach the gun to the hand, and you're set. If you have option to view yourself in third person (or other players), you could as well give your character a complete skeleton and of course a body/mesh.

Basically, look at the animation demos, and imagine attaching the camera to head of the puppet, if your body is never in sight, you can optimize performance a bit by turning off the meshrenderer of your player (or put it in a layer you don't draw with your camera).

yeah I was thinking of that too, but what if he wanted to have multiple weapons?... oh I know, I have a different arm for each weapon!!!

um... If you wanted to make a SINGLE PLAYER, you could get the first person player file off of unity3d. I have no clue how to help you with MULTIPLAYER.

You could make a single character model, and put ALL weapons in his hand, but only render one at a time. I'm working on a crazy fighting game, and that's what I did. Each character controller has almost 100 items to them, from guns to swords to grenades. wings. but it only renders when I tell it to in-game. The whole renderer.enabled: Boolean thing is a life-saver!

You could use other programs to create characters and animate them by using blender( free open source) or Maya. I use both but I don’t mind which one I use. Just animate the reloading animation and export as FBX. You can look at Blender tutorials at their website or other websites.

Well in games like Call of Duty, there are two kinds of motion involved with the guns. There is a following the camera motion, and the walking animation motion. (The following the camera motion shows when you boost the sensitivity really high and spin, while looking at the gun. It moves to follow the camera.) To do this you can apply this script to your weapon:

public var MoveAmount : float = 1.0;
public var MoveSpeed : float = 2.0;
public var GunObject: GameObject;
public var MoveOnX : float;
public var MoveOnY : float;
public var DefaultPos : Vector3;
public var NewGunPos : Vector3;

function Start () 
{
 DefaultPos = transform.localPosition;
}

function Update () 
{
 MoveOnX = Input.GetAxis("Mouse X") * Time.deltaTime * MoveAmount;
 MoveOnY = Input.GetAxis("Mouse Y") * Time.deltaTime * MoveAmount;
 NewGunPos = new Vector3 (DefaultPos.x+ MoveOnX, DefaultPos.y+ MoveOnY, DefaultPos.z);
 GunObject.transform.localPosition = Vector3.Lerp(GunObject.transform.localPosition, NewGunPos, MoveSpeed* Time.deltaTime);
 
 if(Input.GetMouseButtonDown(1))
 {
 GetComponent("Gun Movement").enabled = false;
 }
}

As for the Animation while moving script, You can look at the Unity Documentation Page about Animation Scripting here: http://docs.unity3d.com/Documentation/Manual/AnimationScripting.html

I’m guessing this post is old, but for anyone with the same questions, here you go.

If this appears twice I apologize, becuase I didnt see it show up on my screen.

Anyway, There are two kinds of movement with gun models that you can see in most FPS games worth their salt, and they are Gun-To-Camera Movement, and Walking Animation Movement. GTC Movement is when you move the camera and the gun model shows a delay instead of always pointing in one direction. It seems more dynamic. The Walking Animation Movement is when you move, and the gun plays an animation to show that your moving(sometimes this is applied to the camera as well as the gun, because it shows a bobbing effect.

To do the GTC movement apply this script to the gun GameObject:

public var MoveAmount : float = 1.0;
public var MoveSpeed : float = 2.0;
public var GunObject: GameObject;
public var MoveOnX : float;
public var MoveOnY : float;
public var DefaultPos : Vector3;
public var NewGunPos : Vector3;

function Start () 
{
 DefaultPos = transform.localPosition;
}

function Update () 
{
 MoveOnX = Input.GetAxis("Mouse X") * Time.deltaTime * MoveAmount;
 MoveOnY = Input.GetAxis("Mouse Y") * Time.deltaTime * MoveAmount;
 NewGunPos = new Vector3 (DefaultPos.x+ MoveOnX, DefaultPos.y+ MoveOnY, DefaultPos.z);
 GunObject.transform.localPosition = Vector3.Lerp(GunObject.transform.localPosition, NewGunPos, MoveSpeed* Time.deltaTime);
 
 if(Input.GetMouseButtonDown(1))
 {
 GetComponent("Gun Movement").enabled = false;
 }
}

And for the Walking Animation movement you can check out this: http://docs.unity3d.com/Documentation/Manual/AnimationScripting.html