Weird bugs: Huge differences between Editor and Build

This is very strange.

First, I’ve noticed that physics can behave completely differently in the editor vs in a build. This can make it very difficult to estimate how things are going to work. Certain types of single impulse forces, for example, can be 5 to 10 TIMES more powerful in a build than they appear when playing in the Editor. I have a “launcher pad” type thing that is just insanely stronger in a build, than it is in the Editor.

Second, for the first time I just ran into a bug where an object actually changes its rotation during a Build. I can see it turn while the game is Building. Goes back to normal when done, and it’s fine in the Editor. However, in the Built game, it is turned on its side in the game world from where it is supposed to be.

You should video cap that.

Sounds like you’ve made the code framerate-dependent. Since builds run faster than in the editor, things like this happen unless you make sure your logic doesn’t depend on a certain framerate.

Not sure about the rotation thing though.

–Eric

That is not the case. Any and all movement occurs via forces in FixedUpdate() (which is not framerate dependent) and nowhere else.

It’s only physics which are affected.

At first I thought the Editor was somehow running at a different Fixed Timestep than any builds, but the behavior even changes with single impulse forces (which don’t apply over more than a single Timestep).

I will say this. I have noticed that there are all sorts of physics bugs that take hold once you constrain Rigidbody position or rotation on certain axes (I have to do this, as this is a 2D game). I suspect it has something to do with this.

Some other examples:

  • I had an Rigidbody object that, during gameplay, turns Kinematic and gets parented to another object. If I do this more than a couple times in short succession, the Scale of the object will get grossly inflated at the instant of parenting. The object gets huge for no reason. I’m not manipulating Scale in my code in any way - it’s just happening on its own.

  • Velocity momentum caused by collision between two Rigidbodies will be lost immediately after collision if one of the Rigidbodies has its rotation constrained on any axis.

Hi,
Did you found the solution? I have the exact same problem…

Since this is from 2012, could you create a new post and detail exactly what is different, your specs and what you are targeting.