Player shoot up in the air HELP

hey i having some problem with my player when he goes in walk animation he shoot strait up in the air but in idle (has hand down it shoots strait)

var bulletPrefab:Transform;

function Update () {

	var bullet = Instantiate(bulletPrefab, GameObject.Find("spawnPoint").transform.position, Quaternion.identity);
	bullet.rigidbody.AddForce(transform.forward * 2000);


Uh, your post is a little confusing… Are you having a problem with the character not shooting in the direction his hand is pointing?

If so, you need to tell your code which way the hand is pointing. Here’s how I do it:

var newprefab : GameObject; 
newprefab = Instantiate(bulletPrefab, transform.position, transform.rotation);

The instantiated object should now be pointing in the same direction as the object it was spawned in. Then I apply force to the bullet object in a separate script, like so:

rigidbody.AddForce (Vector3.forward * 2000);

(And if that wasn’t really the problem you were having, clarify your post a little…)