Hi, i have problem with script. When i type transform.forward
the bullet only drops from the gun and if i type transform.right
it shoots backward
Here is the script
var Bullet : Transform;
var Spawn : Transform;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
function Shoot()
{
var pel = Instantiate(Bullet, Spawn.position, Spawn.rotation);
pel.GetComponent.<Rigidbody>().AddForce(transform.right * 2000);
}