Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Locking articulated physics to a virtual 2D plane only works for y/z not x/y

Discussion in 'Physics' started by instinctvfx, Jan 6, 2024.

  1. instinctvfx


    Mar 27, 2020
    For context: I am trying to simulate articulated physics. I have a 3d project with 3d physics because the 2d implementation lacks target motor on the hinge joint and i want to use 3d rendering.

    I have 2 capsules with a hinge joint. I use the mouse y position to change the target angle of the spring. As I need this to be 2D only, i set Freeze Position and Freeze Rotation in both RigidBodies accordingly.

    Seems to work quite nicely. But i jused defaults, and that means that the "2D plane" the bodies are fixed to is z/y. I would prefer it to be x/y so that z is basically depth from a side camera perspective.

    So i changed Freeze Position from X to Z and Freeze Rotation from Y/Z to X/Y. Then i changed the axis of the Hinge Joint to be z.And here comes the weird part. That seems to work somewhat, but is very unstable.

    Whereas the original config is really stable. Why would it work in one plane and become unstable in the other?