- Home /
Question by
Slidingtomcat · Jul 22, 2012 at 05:50 PM ·
identifierunknown
how to fix unknown identifier?
heloo all iam new in unity.I got a problem it says unknown identifier this is my script
function OnCollisionEnter( collision : Collision ) { var contact : ContactPoint = collision.contacts[0]; var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal ); var instantiatedExplosion : GameObject = Instantiate( explode, contact.point, rotation ); Destroy( gameObject ); }i follow this script in adobe reader and it says unknown identifier
THX please answer!!
Comment
Answer by aldonaletto · Jul 22, 2012 at 07:10 PM
You should have the variable explode declared at the beginning of the script:
var explode: GameObject;
This will make a Explode field to appear in the Inspector when the object to which this script is attached is selected - drag to it the explosion prefab
if his answer solved your problem, be sure and check it as accepted
Your answer
Follow this Question
Related Questions
Unknown Identifier maxSlope 1 Answer
HealthPack Script Problem... 1 Answer
BCE0005: Unknown identifier: 'transform' 2 Answers