okay, so i’ve created a script that has no errors in it. But the problem is that it does NOT do what i want it to do! I want it to shoot out a bullet( in this case a cube) out of the gun. but noting happens when i press left click.
var BulletPrefab:Transform;
var force : float = 2000;
function Update ()
{if(Input.GetMouseButtonDown(0))
{var bullet = Instantiate(BulletPrefab,
GameObject.Find("spawnPoint").transform.position,
GameObject.Find("AK-47M").transform.rotation);
bullet.rigidbody.AddForce(bullet.transform.forward * force);
}
}
as i said, there are no errors which makes it unable to copy and use. it just doesn’t do what i want it to do.