- Home /
Collision Detection
Hello, I asked a similar question earlier and got many helpful responses. My script no longer has errors but neither does it work.
The script is supposed to detect when the sphere in the screen shot hits the cube and remove both. However it actually does nothing and I get no error messages. Help would be very much appreciated.
var wall : GameObject;
function OnTriggerEnter (col : Collider) { Destroy (gameObject); Destroy (wall);
}
Answer by Mike 3 · May 13, 2010 at 03:41 PM
Check that the sphere has a trigger collider and a rigidbody attached
The script looks fine otherwise
Trigger collider? I can't find that. I looked through components a couple times and I don't see it.
It's a normal collider of any sort you like with the Is Trigger box ticked
Was is you who asked this question under the name Jake http://answers.unity3d.com/questions/9980/help-with-collision-script/9983#9983? It would be appreciated in the future if you posted a question like this as a comment on that page to keep the site uncluttered and the answer is more complete.
If that is not you, I'm sorry for accusing you of anything.