- Home /
Something wrong with destroying script
#pragma strict
var CUBE_1 : GameObject;
function OnCollisionEnter (col : Collision)
{
if(col.gameObject.name == "CUBE_d_1")
{
Destroy(col.gameObject);
Destroy(CUBE_1);
}
}
This is scrpit what remove CUBE_1 and CUBE_d_1 from scene if happen collison between fpc (this is script is attached to fpc) and CUBE_d_1. But something is wrong. Can you tell me what? It normally destroy CUBE_d_1 when happen collsion, but not destroy CUBE_1...
Comment
Your answer
Follow this Question
Related Questions
OnTriggerEnter is not running! Need help with collision. 2 Answers
Instantiate 1 object after 2 objects collide. ( C# ) 1 Answer
Trigger if 3 Objects Collide at the same time 0 Answers
Temporarily ignore collisions between player and enemies 2 Answers
why is OnTriggerEnter Destroy working once then stoping? 0 Answers