Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

HingeJoint2D ignores motor parameter changes from script

Discussion in 'Windows' started by Lycean, May 19, 2014.

  1. Lycean

    Lycean

    Joined:
    Apr 9, 2013
    Posts:
    2
    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.
     

    Attached Files:

  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    Please report a bug. Thanks.
     
  3. pumpkinszwan

    pumpkinszwan

    Joined:
    Feb 6, 2014
    Posts:
    214
    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
     
  4. Lycean

    Lycean

    Joined:
    Apr 9, 2013
    Posts:
    2
    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!
     
    Last edited: May 27, 2014
  5. pumpkinszwan

    pumpkinszwan

    Joined:
    Feb 6, 2014
    Posts:
    214
    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).