Search Unity

Hinge Joint Issue

Discussion in 'Scripting' started by Nigey, Jan 15, 2014.

  1. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Hi Guys,

    I'm trying to attach a hinge joint from one gameobject to another gameobject. They are both going to have rigidbody's, and they're both going to be a similar mass..

    However I want one to be an immovable object in relation to the engine driving the other object, BUT still keeping physics and collision turned on for anything else that hits it... Is this at all possible?

    The hinge joint seems so perfect for what I want to do, but I don't know how to do it yet...
     
  2. Josh707

    Josh707

    Joined:
    Jul 12, 2012
    Posts:
    71
    Yes, you should be able to either enable the isKinematic or all freeze position and rotation checkboxes in the inspector
     
  3. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Yeah the problem with that though is if I freezer the position in the inspector it wont move at all, ever. I want the object to move in relation to physics, but not according to it's own hinged components moving individually... Like for example a man with a ball chain swinging round his head... I want him to swing the ball chain without him flopping in the opposite direction like a seesaw, but at the same time.. When he's hit by things I want him to fall backwards naturally in line with physics.. Do you get me now? I don't know how to do this?

    Would it be a case that I have to reprogram the actual hinge joint itself? I've looked at custom joint and I don't know if that would do it either..... Can anyone help?
     
  4. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    I've also tried resetting the hinge joint's position according to the other object in FixedUpdate, so it constantly is attached, but not directly affecting the other objects physics, but it just freezes...
     
  5. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Bump.
     
  6. Josh707

    Josh707

    Joined:
    Jul 12, 2012
    Posts:
    71
    I don't exactly understand what you want, do you mean have the hinge joint work normally but have the root object not affected by forces from the chain part? Maybe you could hold the root object in place with counter forces
     
  7. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Yeah that's exactly what I meant Josh.. I think that's my only option really. Okay thanks, know what to do :)
     
  8. Josh707

    Josh707

    Joined:
    Jul 12, 2012
    Posts:
    71
    Oh ok, good luck with that, it sounds like a somewhat difficult problem! :p