Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 starstriker1 · May 23, 2011 at 03:27 AM · jointconfigurablejointspringjoint

How to use multiple spring joints on the same object?

I'm trying to implement physics in a fashion similar to World of Goo, with multiple nodes connected in a mesh of springy constraints. I've been able to implement this in codebases other than Unity (such as Box2D) with spring constraints. Unity's spring joint looks perfect for the task, but unity won't allow multiple SpringJoint components on the same object, which makes that unworkable (as far as I know).

The ConfigurableJoint component DOES allow duplicate components, but the settings for it are a pain to figure out and I can't get it to approximate the spring joint. If I could, that would solve my problem, but so far experimenting with the values hasn't yielded anything.

What would be my best approach for implementing this? Is there a straightforward way to configure the configurable joints to do what I want? Is there another approach entirely I haven't considered?

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
2
Best Answer

Answer by Waz · May 23, 2011 at 04:25 AM

Child objects of the GameObject with the Rigidbody can each have a SpringJoint on them. You'll probably wand to model it that way anyway as the joints need to be created and removed dynamically in your game.

Comment
Add comment · Show 2 · 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
avatar image starstriker1 · May 23, 2011 at 08:16 PM 0
Share

Thanks, that appears to do the trick. However, to get it to work I needed to add two joints to the child object: a fixed joint to secure it to the parent object (which it was acting independently of) and a spring joint to connect to another. This seems wasteful: I have one more joint and one more rigidbody than I need for every link I create. Is there a way to optimize this?

Thanks!

avatar image psdev · Nov 08, 2011 at 11:22 PM 3
Share

This method Warwick describes works for me, I am using SpringJoints on the hair and hands of a character to get secondary animation on them based on their parent's motion. In my case I am not using fixed joints. For each thing I want floppy, I:

  • Create an Empty GameObject (I call them null points) called "Anchor"

  • place it at the point of the neutral position of the appendage I want floppy and Parent it to that child object or bone (By the way I would use bones or null points to do your world of Goo style thing)

  • Add a Rigidbody to that Anchor point and set the Is$$anonymous$$inematic on

  • Create a 2nd Empty GameObject called "Springy" and position it near but a little bit away from the Anchor - but DO NOT parent this one

  • Add a RigidBody to Springy and turn its Gravity on

  • Add a SpringJoint to Springy and set its Connected Body property to the Anchor null in your scene

  • Set Gizmos for each of the null points and turn on Gizmos for runtime

  • Play with the numbers for Spring, Damper and drag until you get the motion you like and then you can turn off runtime Gizmo display

In my case, multiple SpringJoints are on separate bones of the parent object. I wish someone had spelled out use of SpringJoints for me before (the docs are horrible) and I find them quite useful... :)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How can I make a configurable joint behave like a spring joint? 0 Answers

How do I set up a configurable joint to Behave like a Spring Joint? 1 Answer

Difference between creating Configurable Joint in code and creating the same type of Joint in script 1 Answer

"bleeding" when using configurable joints 2 Answers

Violent shaking when using position drive in Configurable Joints 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