• 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
2
Question by Sinaz · Nov 16, 2009 at 09:25 AM · physics

Like a zero-G Newton's Cradle?

I'm trying to engineer a physics model similar to a Newton's Cradle (those click-clack office toys) as if the anchor for every ball were in a cocentric point, and gravity was not an applicable force. I want to use the rigidbodies, colliders, and joints... the notion is that all of the balls would be stationary around this center point, and you could apply a force or torque to one of the balls and it would begin colliding with other balls in the spherical 'cloud' of balls -- all of which are constrained by its rigid, yet freely rotating tether to the anchor.

I've tried a few simulations, but I don't think I fully understand how to set up configurable joint and keep it firmly anchored... I'm having a hard time understanding, through documentation, how joints, rigidbodies, and colliders interact.

Some guidance on setting this up and explanation of how the various components will interact and constrain each other would be really great!

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

Answer by runevision · Nov 16, 2009 at 04:52 PM

It sounds like you want all the balls to be attached (via a pivot point) to the World and not to each other.

For each of the balls, you can do this:

You can use a Configurable Joint and in leave the Connected Body variable empty. This connects this Rigidbody with the world.

Set the Anchor to be a point relative to the ball itself, which should be the pivot. For example, if you have a ball at <0,-10,0> that you want to rotate around the origin <0,0,0>, then you need to specify the Anchor as <0,10,0>.

Now, set the XMotion, YMotion, and ZMotion to Locked. Leave the Angular XMotion, Angular YMotion, and Angular ZMotion set to Free.

You can disable gravity in the Rigidbody component.

The above seems to work for me.

Comment
Add comment · Show 3 · 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 Sinaz · Nov 16, 2009 at 06:23 PM 0
Share

Very nice, thank you. The balls seem to have a springyness from the anchor that I cannot fully disengage. I am setting the positional offsets and anchors of the rigidbodies OnAwake(), despite the docs recommendation that I set them to ideals in the editor. I'm wondering if the initial position changes are being registered as velocity. Are there values that will set the linearLimit as a rigid spring that won't have any give?

avatar image runevision ♦♦ · Nov 16, 2009 at 08:39 PM 0
Share

I am afraid this is where my knowledge ends. Perhaps you can ask a new question with the more specific sub-problem you still need to solve, and somebody might notice it better. Like e.g. "Controlling ConfigurableJoint springyness from script".

avatar image Sinaz · Nov 17, 2009 at 10:42 PM 2
Share

I have solved this. It turned out to be very simple.

The solver for the joint seems to always treat the joint with some sort of elasticity. Therefore, mucking about with the XYZ$$anonymous$$otions and LinearLimit seem to fail at eli$$anonymous$$ating all of the bounciness regardless of how tightly you attempt to limit it. You either get a spring that bounces, one that stalls, or one that explodes.

However! If I leave them locked, and set the Projection$$anonymous$$ode to Position Only, then the correction this applies completely overrides the default springiness-- the joint always snaps to its intended length each frame.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

2D 360 degress platformer example needed 0 Answers

OnCollisionEnter isn't working between two RigidBodies 1 Answer

I have a sphere and a mesh (roulette table). Physics doesn't work. 2 Answers

Is it possible to get the physics engine to ignore calculating a rigidbody? 1 Answer

Ball Bearing Simulation With Rigidbody's? 0 Answers


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