Hi all!
I have just started playing with Unity and I have come across this problem: I have a script containing OnCollisionExit function attached to an object with rigid body component. Everything works fine except when I disable the script component. Actually the engine ignores the “enabled” flag in the component and executes the commands in the mentioned function on collision regardless of whether the script is enabled or not. It doesn’t happen with Update function though.
Am I missing something out or is this normal? Thanks for the responses.
Here’s the code:
function OnCollisionExit(col:Collision){
GetComponent("Rigidbody").useGravity = false;
}