Hello guys I need your help when press a button on the mouse to shoot the bullet it moving to the right, I want it moving forward, please, help me, I use this script below , You can see the picture below also.
var Bullet : Transform;
var Spawn : Transform;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
Shot();
}
}
function Shot()
{
var pel = Instantiate(Bullet, Spawn.position, Spawn.rotation);
pel.rigidbody.AddForce(transform.forward * 8000);
}