Bug appears only in release mode

What do you do when you have a bug that appears only in release mode ?

What happens is that i make something like:
pin2.active = false
pin3.active = false
pin4.active = false

but after the second pin is deactivated the ball also disappears completely from the game and its coordinnates are all messed up even if i force them.
Everything works fine under the editor, the problem appears only on compilation of an app or a web player.

how do you track/fix such bugs ?

thanks!
Patricia.

I haven’t done much debugging of builds, but AFAIK debug.log outputs to the console unless you strip debug symbols in the build options. So maybe you can trace the source of the problem that way?

Thanks, well i have located the bug, but i don’t know how to fix it :frowning:

after i do the 2nd pin.active = false , then my ball disappears completely from the game and there is no way of getting it back. I can still see some things moving far away so it’s not crashed.

Is there any other way of disabling an object ? ( for now i’m just going to put them far away in the scene so that they don’t get deactivated ).

Patricia.

Would turning off its renderer and destroying its components work? Or destroying the whole thing?

renderer.enabled=false;
Destroy(rigidbody);

It might actually be

Destroy(gameObject.rigidbody);

http://unity3d.com/Documentation/ScriptReference/Object.Destroy.html

untested, use at own risk
AC :wink:

Probably there is some unhandled exception, you can open the console to see error messages.

Ok i have been able to find a work around.

What happens is that it seems that you can’t deactivate an object that has a current physic calculation on it. the ball was laying on a stack of pins, if i activate=false a pin, then the engine seems lost.

I moved the ball away, then i did pin.activate = false

now the ball behaves normally! very very strange behaviour ( and it only does it in release mode )

Patricia.

Debug.log outputs to the console regardless of whether debug symbols are stripped, since it’s not related to debug symbols, except for having “debug” in the name…

–Eric