Collision works in editor but not in executable

I’ve made a simple script where when a trigger collides with a rigidbody, the rigidbody is destroyed. It works perfectly during the testing in the editor, but when i create the executable, it doesn’t even work. It simply doesn’t detect the collision. I wanted to know what are the things that change about game’s physics between the inspecor and the executable. The trigger object has a box collider, and so does the object with a rigidBody component.

It works sometimes in the executable run, especially when I make the rigidbody fall on the ground instead of placing it in the ground at start. But I don’t really now why it does this. It’s really weird.

So what I want to know is, what are the differences between the inspector and the executable so I can try to find out what’s happening, or if someone has already the answer I would really appreciate it.

Thank you

Ok, sorry for that triple-posting, but I’ve found out what my problem was and as I’ve found it interesting, I’ll post the answer for my own problem to see if I can help anyone in the future.

My problem is explained completely here: http://unity3d.com/support/documentation/Components/RigidbodySleeping.html

When a rigidbody is standing for a long time, it starts “sleeping” to avoid wasting unnecesary resources, and stops having collision detection. There are several ways to awake a rigidbody when it’s in this mode, but a simple collider trigger box won’t wake it up, I solved my problem adding a kinematic rigidbody component to my character’s sword so it awakes the ridigbody the same time it collides with it.

The most weird thing about it all is that this problem doesn’t show up during the editor testing, so it was driving me mad.

Anyway, I hope this helps someone, and sorry for that triple-posting

I’ve been trying to fix it and I’m preety sure it’s not a problem of coding, It’s just that the OnTriggerStay() Function is sending the events correctly in the testing, but it’s not even working during the executable play.

What I’m trying to accomplish is a simple melee attack, my character has an animation, and a box collider (trigger) attached to his sword. When it collides to another object, with a box collider and a rigidbody attached and a static variable named attack it’s activated at the same time (i control wether this variable activates or not with yield WaitForSeconds() and it works really well during the editor test), it destroys the “other” collider.

Another thing that may be relevant is that when I was testing in the editor, I found it only worked when the collision detection field at the rigidbody was Continuous or Continuous Dynamic but didn’t work with discrete

I hope this was helpful for clarifying a little bit more my question