Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Tim · Dec 30, 2010 at 03:46 PM · jointhingejointconfigurablejoint

How do I set up a ConfigurableJoint so that it behaves just like a HingeJoint?

I'd like to set up a ConfigurableJoint that behaves exactly like a HingeJoint. I want to do this so I can lock the joint at certain times. I saw a similar question and the answer makes sense for basic setup, but I'm not getting the same behavior as my HingeJoint.

I think my Angular XDrive parameters don't match what Unity uses for its HingeJoint. Does any one know what settings Unity uses? I'm using velocity mode because the motor of a HingeJoint only takes a target velocity. I haven't assigned a value to Position Spring or Position Damper.

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
4

Answer by taters · May 25, 2011 at 02:23 PM

Hi,

to mimick a hinge joint, you would need to set the config joint as:

XMotion, YMotion, ZMotion all on 'Locked'
angularXMotion, angularYMotion, angularZMotion all set to 'Free'
set angularXDrive mode to 'position'
set angularXDrive spring to '20' or whatever.
set angularYZDrive mode to 'position'
set angularYZDrive spring to '20' or whatever.

then set the 'Target Rotation' to be what you want. If you want an 'angle', like 90 deg, then you can use:

somejoint.targetRotation = Quaternion.Euler(new Vector3(0,90,0));

All this is relative remember, so if you have the object in the position you want already, then leave rotation to 0 then it should just act like a springy thing in all axis (from the pivot point of course)

The above is more like a springy ball socket joint actually. If you want a true hinge, just 'Lock' the appropriate angular?Motion things you want frozen (e.g a hinge on X you would lock Y and Z angular motion). or just leave 0 in the vectors when setting the Target Rotation.

You could then 'lock the joint at certain times' by setting the target position (make sure the spring is set high enough). Add damping on it too to stop it going bananas when it goes to its target if the spring is high.

This way, all physics will behave happily.

This is presuming you are adding the components through the editor, not with scripting. (...or are you wanting to do it all through script?)

Hope it helps / hope its correct - sorry if it's not - going from memory. :)

Dave

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

When add joints to wheelcollider then it is not collide with other collider 0 Answers

Sloppy HingeJoints 0 Answers

hingeJoint.angle equivalent for ConfigurableJoint? 4 Answers

hing joint issue,Hing Joint Issue in tow truck 0 Answers

Joint: Swing & Twist? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges