I’m new to Unity3D, and i have no experience with scripting whatsoever.
I followed the instructions on Unity’s FPS tutorial, but now I’m stuck with the MissileLauncher.js thing. I get two errors. Both of them say ‘BCE0005: Unknown identifier’, one for projectile, the other for speed. I seem to get problems on variable declaring. Please help.
function Start ()
{
var projectile : Rigidbody;
var speed = 20;
}
function Update()
{
if( Input.GetButtonDown( "Fire1" ) )
{
var instantiatedProjectile : Rigidbody = Instantiate( projectile, transform.position, transform.rotation );
instantiatedProjectile.velocity = transform.TransformDirection( Vector3( 0, 0, speed ) );
Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );
}
}