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
1
Question by THEAK472009 · Jul 19, 2013 at 06:44 PM · physicscolliderhollow

How to make a bead shaped object pass through a string

I am trying to make this bead shaped object pass through a cylindrical helix. I have tried adding all kinds of colliders and tweaking their properties, both objects have a RigidBody, but the sphere just falls through the helix instead of passing(flowing) through it.Need Help! I have posted a couple of images for your reference. Thank You. alt text![alt text][2]

alt text

image1.jpg (51.7 kB)
image4.jpg (37.0 kB)
Comment
Add comment · Show 5
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 gardian06 · Jul 19, 2013 at 06:50 PM 0
Share

if you exa$$anonymous$$e the mesh collider of the helix does it follow the mesh appropriately, and does the mesh collider of the "bead" follow the shape

avatar image robertbu · Jul 19, 2013 at 06:52 PM 1
Share

I don't think you can make this work. Generally two mesh colliders cannot collide. You can 'solve' this problem by marking them 'convex', but I think you will lose your hole in your bead if you do it this way. It might be possible to crate a mesh that rides the string (not a bead with a hole). $$anonymous$$ore info on mesh colliders here:

http://docs.unity3d.com/Documentation/Components/class-$$anonymous$$eshCollider.htm

You could simulate this behavior by defining a path and then moving the bead along the path. iTween is one solution for define a path and moving an object along that path. There are more packages in the asset store for path following as well as a number of posts on the issue here on UA.

avatar image THEAK472009 · Jul 20, 2013 at 03:29 AM 0
Share

Thanks man! iTween worked! But I am still unsatisfied as the Physics Engine isn't able to do this thing.

avatar image kromenak · Jul 20, 2013 at 04:01 AM 0
Share

This might work if you only use a mesh collider for one of them - use basic box or sphere colliders to approximate either the coil or the bead.

But dealing with the physics forces and friction and indeter$$anonymous$$ate nature of physics would be a nightmare - much easier to go with iTween unless the player is supposed to apply forces to it or something.

avatar image You! · Jul 20, 2013 at 05:02 AM 0
Share

Using the physics engine wouldn't be bad, but it would require more work. The helix would need a compound collider, which is made by adding children to the gameobject and giving those children appropriate colliders, such as capsules. Re-positioning of the colliders would allow you to make a spiral which would work.

Compound colliders are also mentioned with capsule colliders here: http://docs.unity3d.com/Documentation/Components/class-CapsuleCollider.html

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by s_guy · Jul 20, 2013 at 11:00 AM

I presume you mean to have the bead pass over or around the unmoving helix so that it will follow a spiral path. (The helix is going through the bead.)

The physics engine isn't good at dealing with problems where complex surfaces are in continuous contact. Even if you get it working, the parts will probably just rattle around and not get the smooth result you probably want. The physics engine is better at sparse scenes where convex objects occasionally collide with each other.

For this, it would be better to make sure the two parts don't have physics collisions and just animate the bead's position.

This is the formula for position over time t of a regular spiral up the Z axis:

 x(t) = cos(t)
 y(t) = sin(t)
 z(t) = t 

Check it out:

alt text (snagged from Wikipedia)

You'll have to multiply t by some factor and each line by some factor to get a perfect fit with your exact helix.

It might look something like this:

 x(t) = cos(t) * ConeRate * t
 y(t) = sin(t) * ConeRate * t
 z(t) = t * StretchRate

...where ConeRate is a value that affects how big the spirals get and StretchRate is a value that affects how tight the helix is along its axis.


rising_circular.gif (508.2 kB)
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
avatar image
0

Answer by temptest123 · Jul 20, 2013 at 11:33 AM

both your meshes are concave, so you would need concave mesh colliders (untick the convex checkbox). But unity does not compute collisions between concave meshcolliders (as such collisions are costly).

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
avatar image
0

Answer by THEAK472009 · Jul 20, 2013 at 01:02 PM

The iTween method was bound to work perfectly.The capsule collider method worked perfectly. The animation method too worked perfectly! I added a trail renderer for a better visual effect. Thank you all for helping!

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

19 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

Related Questions

Strange Physics being applied to objects issue. 1 Answer

Two even colliders causing bounce at transition 1 Answer

Collision Issue - Walk Through Object 0 Answers

Make Ray hit own collider 1 Answer

Calculate the normal of a collider 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