- Home /
Easy explosion script
Here's the script:
var explosion : GameObject;
function OnCollisionEnter (collision : Collision)
{
Instantiate (explosion, transform.position, transform.rotation);
Destroy (gameObject);
}
But it says that the referenced behaviour is missing. I set the explosion, I gave everything rigidbodies, but it still doesn't work.
[Edit] It looks like Detonator doesn't work.
can you paste the whole error code. but its probably "explosion" missing.
yes I would assume that you have not assigned something to explosion variable in the inspector
Either that or a GameObject has lost its connection to a $$anonymous$$onoBehaviour somewhere in your scene.
Answer by Unamine · Jun 03, 2011 at 11:09 AM
Try add the gameobject Explosion in the variable
Your answer
Follow this Question
Related Questions
The referenced script on this Behaviour is missing! 4 Answers
Refenced script on this behavior is missing? 17 Answers
The referenced script on this Behaviour is missing please help. 2 Answers
Search and Destroy 1 Answer
Adding Explosion Sound Effect 1 Answer