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 SeqLog · Apr 19, 2014 at 10:00 PM · ropespring joint

Rope simulation - Double spring joint problem

Hello! I am trying to simulate rope physics with spring joints (As hinge joints gave me serious trouble), and in order to appropriately simulate that thick rope has a maximum bend, I have attatched spring joints at every other joint.

http://imgur.com/QkpBFCc <- Like so

But Unity doesn't seem to like this! The "rope" starts to jiggle and bounce everywhere. I suspect I am doing something awfully wrong, someplace, but I can't quite figure out where.

arrOfGameObjects is an array of instantiated prefabs.

 for(int i = 0; i < maxCount; i++)
         {
             //The last should not have a spring attached
             if(i < maxCount - 1)
             {
                 SpringJoint spring = arrOfGameObjects[i].AddComponent<SpringJoint>();
                 spring.spring = springValue;
                 spring.damper = dampening;
                 spring.connectedBody = arrOfGameObjects[i + 1].rigidbody;
                 SpringDrawer drawer =  arrOfGameObjects[i].AddComponent<SpringDrawer>();
                 drawer.target = arrOfGameObjects[i  + 1].transform;
                 drawer.width = 0.1f;
                 drawer.Init();
             }
             if (i < maxCount - 2)
             {
                 SpringJoint spring = arrOfGameObjects[i].AddComponent<SpringJoint>();
                 spring.spring = springValue;
                 spring.damper = dampening;
                 spring.connectedBody = arrOfGameObjects[i + 2].rigidbody;
             }
         }


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
0

Answer by Owen-Reynolds · Apr 20, 2014 at 06:23 AM

Springs spring -- a rope connected by a bunch of Spring Joints in a row, is a slinky. It should have crazy up&down bounces and waves running though it.

I'm guessing this is 2D? A hinge joint just needs tuning. Make sure it hinges in the correct direction, at the correct point, colliders not too far or close... . For a 3D rope, use a characterJoint. I don't think I've ever seen a good explanation of how to set all the numbers (swing axis2? I just leave it alone.)

Comment
Add comment · Show 4 · 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 SeqLog · Apr 20, 2014 at 06:44 PM 0
Share

I've been trying back and forth with the different joints, and none of them seem to produce stable results, other than the spring joint. The character joint sort of just wobbles, never really reaching a good resting position, and the configurable joint jiggles out of control, no matter the drag constraints I define.

It is in 3D.

avatar image Owen-Reynolds · Apr 21, 2014 at 04:44 AM 0
Share

All the joints work, if you can figure out how to set them up properly, which is tricky. I've made some ropy-things with 3 charJoints in a chain, which bounce around realistically. I've also made some horrid ones that twitch like they're on one of those hotel vibrating beds.

avatar image SeqLog · Apr 21, 2014 at 07:12 AM 0
Share

I'd like to have at least 10 joints in succession, if not more. Is there any tricks you can give, or a train of thought that I've missed in creating it?

avatar image Owen-Reynolds · Apr 21, 2014 at 02:08 PM 0
Share

I"m not sure the system can handle 10 in a row, even w/solver count or whatever jacked up. For charJoints, the orange arrow goes along the long axis of the limb (unlike hinges,) starting maybe just past the end, in the middle of the gap to the next collider. Not sure why it's so hard to find examples.

I just noticed the extra springs in your image. Eeew. CharJoints can limit bends all by themselves. Set it low, since Spring past 0 will let them exceed the limit.

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rope Physics using Spring Joints 3 Answers

Making a Vibraating string. Need Help!! 0 Answers

Control the length of a Rope 0 Answers

Make a rope with Joints 1 Answer

How to fix 'jumping' behavior with hinge joint 2D 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