I started using Unity from yesterday and I have tried to script a gun to fire through java script and the bullets fire out sideways!? any help
Heres the Script
var BulletPrefab:Transform;
var force : float = 6000;
function Update()
{
if(Input.GetButtonDown(“Fire1”))
{
var bullet = Instantiate(BulletPrefab,
GameObject.Find(“spawnPoint”).transform.position,
GameObject.Find(“Gun”).transform.rotation);
bullet.rigidbody.AddForce(transform.forward * force);
}
}