Hello,
I have this script attached to my gun model :
#pragma strict
var bulletPrefab : Transform;
var player : GameObject;
var force : float = 2000;
var shootForce : float = 1000;
function Update () {
if(Input.GetMouseButtonDown(0)){
//fire bullet
fire();
//audio clip
}
}
function fire(){
var instanceBullet = Instantiate(bulletPrefab,transform.position,Quaternion.identity);
instanceBullet.rigidbody.AddForce(transform.forward*shootForce);
}
But my problem is,
The bullet shoots up instead of forward.
Help plz?