OK I’m a newbie so go easy…
I have this code that I’m using while I’m following a tutorial on Unity3d but it seems that the code they are using doesn’t work in the latest version of unity or something because when I attach it to my Main camera nothing happens…
var speed = 3.0;
var cratePrefab:Transform;
function update ()
{
//when you press the button
if (Input.GetButtonDown ("Fire1"))
{
//Create Crate
var crate = Instantiate (cratePrefab, transform.position, Quaternion.identity);
//Add force to shoot it
crate.rigidbody.AddForce (transform.forward * 2000);
}
}
this is supposed to shoot cubes into the 3d world but when I left click nothing happens…
Anyone want to help a newbie out?