HingeJoint2D ignores motor parameter changes from script

Has anyone else noticed that the HingeJoint2D ignores changes to motor parameters such as useMotor or motorSpeed in Windows Store builds?

It works fine in the editor or for standalone builds.

I’ve attached a repro case, any workarounds would be great. If all else fails I’ll just have to use AddTorque directly.

1632433–100587–$HingeJoint2D-Test.zip (21.5 KB)

Please report a bug. Thanks.

Lycean, did you submit this bug?

I just made a similar post before finding this one, and I can confirm similar (but different) behaviour.

On the repro Lycean posted I get no ‘wheel’ movement in Windows 8.1 (both ARM x86 Windows Store builds) - but the ball moves to the right in the Unity editor.

In my own project my motors work in ARM (Windows RT 8.1), but not in an x86 Windows Store build of the same project (and they work correctly in all other builds).

I’m close to releasing my game, so if a workaround exists please share it. I might look into AddTorque.

My post is here: http://forum.unity3d.com/threads/247972-Car-wheels-not-turning-only-on-x86-Windows-Store-build

Hi pumpkinszwan,

Yes, I submitted it and received this reply:

“Thank you for sending a bug report. On Unity 4.3.3f1 Windows Store Apps platform doesn’t support animation using script variables, but we are glad to announce that this issue is fixed in the upcoming Unity 4.5.”

Fingers crossed 4.5 arrives soon.

AddTorque works OK, I do it during FixedUpdate. EDIT: Originially I said that “One thing to be aware of is that I don’t see perfect repeatability with this approach; my results vary a little from run to run. For my game it’s not a showstopper, though I’d prefer it to be perfectly repeatable”. I’ve tracked down the source of the variation (to do with FixedUpdate sometimes firing one extra time after changing Time.TimeSpan to zero during a prior FixedUpdate) and everything is now nicely repeatable.

Also, you obviously lose the motor’s built-in speed control and will have to approximate that yourself if you need it.

Good luck with your game!

Lycean,

Thanks for the extra info. I hope 4.5 comes very soon!

It’s weird that my game works fine on my ARM/RT Surface 2, but fails on my x86 PC (your sample behaves the same on both).