Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rotating a game object with hinge joint children.

Discussion in 'Physics' started by katsuragi545, Jun 21, 2016.

  1. katsuragi545

    katsuragi545

    Joined:
    Jun 25, 2014
    Posts:
    38
    I'm currently creating a rope. I have an empty game object that serves as the rope's parent. This object has several "chains/rope pieces" (you can think of this as a sequence of connected chains/rope pieces. Those pieces each have a HingeJoint component. Right now the rope swings left to right perfectly fine, however, I would like to change the direction at which the rope swings during runtime.

    My original idea to handle this was to rotate the empty game object parent. Unfortunately, this will not work during runtime for some reason. If I rotate the root parent's y rotation value to 45, then the rotate will swing along that angle. I can't seem to figure out how to do this during runtime.

    In a nutshell, how can I rotate hingejoints during runtime??