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 jefferytitan · Mar 21, 2015 at 03:40 PM · physicscollidersconcave

Making complex objects settle under gravity

Hi all,

I'm trying to make piles of junk. ;) For reasons I won't go into here I need random piles of complex objects, and I don't mind the time cost too much because they will only exist for a short time and the player can't interact with them.

My question is how to make complex (often concave) objects settle into a plausible heap under gravity. From what I'm aware you can't collide two concave meshes together.

My first thought is:

  1. Have a rigidbody and two colliders per object - a rough convex collider and a meshcollider.

  2. Start with all using convex colliders only (e.g. turn off meshcolliders).

  3. Drop the objects.

  4. After a little settling time run through the objects one at a time from the bottom to the top. Disable the rigidbody for the object, this is it's final position. Enable their meshcollider and disable the convex collider so things above will settle. This would ensure no concave on concave collisions.

  5. After all objects have been run through, call the process complete.

I don't think the results would be so pretty.

I have heard of other solutions simulating concave objects with jointed convex objects. I'm not sure how stable or performance hungry they are. Also do the physics solvers get more stable answers if you start near the solution or not?

Any help would be appreciated!

JT

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Owen-Reynolds · Mar 22, 2015 at 05:50 PM

Use Compound colliders?

You can assemble standard colliders -- mostly long cubes and capsules -- to create an effectively concave collider. I've only done it with simple L and C shapes -- well, a moving bowl made up of maybe a dozen cube "planks" -- but seems to work fine.

I assume you could even use compound convex Mesh colliders. Like if you needed to build a shape out of wedges, say.

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 JedBeryll · Mar 21, 2015 at 06:49 PM

Rigid bodies have a freeze position option that might work for you. Example: rigidbody.constraints = RigidbodyConstraints.FreezeAll;

Comment
Add comment · Show 1 · 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 jefferytitan · Mar 22, 2015 at 01:59 AM 0
Share

Thanks for the answer. $$anonymous$$y question is more about how to make multiple concave colliders work, and as far as I understand a frozen rigidbody doesn't allow concave colliders.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Does unity take disabled colliders into account with the collider limit? 1 Answer

Pallet falls through forks 2 Answers

Collision detection for many colliders 0 Answers

Collision Precision 1 Answer

Why is it so fast to move objects with collider collisions? 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