Search Unity

Hinge Joint Help

Discussion in 'Editor & General Support' started by agentcooper, Mar 22, 2008.

  1. agentcooper

    agentcooper

    Joined:
    Jan 19, 2008
    Posts:
    98
    Hi guys, I have been looking through the scripting reference and through these forums but to no avail...

    Can anyone give me a brief example of how to implement hinge joints in Unity? I am fairly confident with what the variables and functions that they provide but how do I create one? Is it a case of creating skeleton joints in the Modeling package (I am using Maya 8.5 btw) or is it done purely in the script?

    I just want something basic like doors opening as I approach them...
     
  2. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    How about just creating a game object containing your door mesh with the mesh pushed in local coords?

    The result would be moving the centre of rotation to where the hinges of the door are.
     
  3. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
  4. agentcooper

    agentcooper

    Joined:
    Jan 19, 2008
    Posts:
    98
    Thanks for your responses guys. AngryAnt cheers for your idea but id really like to take advantage of the hinge properties. Checked out your games on your site by the way, very nice!

    yellowlabrador that was perfect, just what i was looking for thanks!
     
  5. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Oh those are not my creations. Merely games I admire. The scale of my involvement in them is simply aiding with suggestions and constructive criticism.
     
  6. yellowlabrador

    yellowlabrador

    Joined:
    Oct 20, 2005
    Posts:
    562
    Eric5h5 uploaded that as an example so I can understand hinges too :D
     
  7. meshpig

    meshpig

    Joined:
    Aug 17, 2006
    Posts:
    178
    Should the standard character controller be able to move the door? I have it hinged properly but it doesn't budge.

    What's the trick?

    Thanks.

    m