cannon script is not working, no errors.

I have this very simple script to launch a projectile. The instantiated object has a constant force component applied to it.

 var projectile : Rigidbody;

function Update()
{

if( Input.GetButtonDown("Fire1") )
{

Instantiate(projectile, transform.position, transform.rotation );

}
}

But oddly, when i hit the fire1 key, absolutely noting happens. Help!

1 Answer

1

Have you tried putting a print in the if statement and see if it gets printed?

dw, i fixed it- not sure what the error was, but i used an older version instead.