- Home /
FPS tutorial projectile scripting error
For the projectile Weaponscript in the FPS tutaorial I typed the following code which, as far as I can tell is correct but I keep getting this error: Assets/Weaponscripts/Projectile.js(5,38): BCE0005: Unknown identifier: 'collision'.
This is the script-
var explosion : GameObject;
function OnCollisionEnter( Collision : Collision ) { var contact : ContactPoint = collision.contacts[0];
var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal ); var instantiatedExplosion : GameObject = Instantiate( explosion, contact.point, rotation );
Destroy( gameObject );
}
Answer by Julian-Glenn · Aug 13, 2010 at 12:53 AM
Unityscript like Javascript is case sensitive. It should be collision : Collision.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
hide child object script - help 1 Answer
How can i make a projectile attack travel through multiple enemies dealing damage to all of them? 1 Answer
Instantiating at Collision Point. 2 Answers
keeping the xp after death 2 Answers