Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Sitrane · Nov 13, 2011 at 09:25 PM · rigidbodycollidermesh

Rigidbody objects not colliding.

I have a scene using some barrels that have Rigidbody colliders on them. The player can then walk up and collide and move the barrels around.

My problem now is that my barrels won't collide with one another.

I am using a Mesh Collider (With a custom simplified Cyclinder mesh for collision) and Rigidbody collider on the barrels.

I have discovered that if I use a Box Collider instead of a Mesh one, the barrels collide like normal.

Any help would be greatly appreciated!

Comment
Add comment · Show 4
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 Quadgnim · Sep 13, 2012 at 05:34 PM 0
Share

Can someone provide more details around this? I have a need for mesh on mesh collision. I have some very large objects that I need to get right up on and a box collider wont work. $$anonymous$$aybe I can use a box or capsule for the smaller object co$$anonymous$$g up on the larger one, but I suspect I'll have some situations where 2 large vehicles are getting up on each other and a crude box to box wont look right?

2 points:

  1. what's this that mesh on mesh won't collide? I'm experiencing this but I don't understand why? Seems like a very odd limitation to me.

  2. when I was writing my own engine I'd use a box or sphere collision for a crude check and then perform a more detailed mesh check only if the box/sphere check shows a collision. Doesn't Unity support something similar, and if so what's the best way to set it up?

thanks

avatar image Eric5h5 · Sep 13, 2012 at 08:48 PM 0
Share
  1. Because it's a very expensive operation. As I mentioned in my answer, you can use convex mesh colliders, but those have limitations (such as, well, being convex, also a max of 256 polys).

  2. Yes, that's what Unity does.

avatar image Quadgnim · Sep 13, 2012 at 09:02 PM 0
Share

Thanks Eric.

Relative to question 2, does this happen automatically? In other words, I don't need to add two separate colliders, right? I suspect internally it's going to do a sphere distance check then apply whatever collider you've chosen for the detailed collision, or do you need to somehow specify how you want it to behave?

avatar image Eric5h5 · Sep 13, 2012 at 09:17 PM 0
Share

Yes, certainly it's automatic.

4 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Eric5h5 · Nov 13, 2011 at 10:07 PM

Standard mesh colliders can't collide with other standard mesh colliders. Only convex mesh colliders can collide with each other. For performance reasons, compound primitive colliders should be used where possible. A capsule/box combo generally works well for barrels (capsule for rolling, box so they stand on end).

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 Sitrane · Nov 13, 2011 at 11:04 PM 0
Share

I see. I had a feeling that might have been the case. Good to know that I actually had thought of the capsule/box combo idea.

Thanks!

avatar image
2

Answer by Legendofcs · Aug 17, 2013 at 03:27 PM

There 2 things 1. Rigid body 2. Mesh Collider

If you have 2 different bodies and both of them are not colliding for some reason then please make sure that they both have the above two properties

Both should be rigid bodies and both must have their meshes.

Example. BodyA is like a box and has Box Collider attached with it, It must be a rigid body attached with it as well BodyB is a sphere and has a Sphere Collider attached with it, It must be a rigid body as well. Both bodies must have their isKinematic checkbox UNCHECKED in order to fall with gravity checkbox checked.

Both bodies will collide if the above mentioned procedures are followed correctly

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 Eric5h5 · Aug 17, 2013 at 04:19 PM 0
Share

You do not want them to have mesh colliders. See my answer.

avatar image
1

Answer by HipJiveGuy · Apr 07, 2019 at 12:44 AM

Sometimes, an object wont collide with another object because you have a public property like a sound or something like that that's not assigned.

If it's not assigned, then any code after trying to play the sound, or using the missing object in some way wont get run!

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 dan3s2020 · Jun 13, 2020 at 12:19 PM 0
Share

It may work by only disabling everything in the scene if my audio source is somewhere there blocking my collisionEnter()?

avatar image
0

Answer by Riqaiun · Jan 19, 2015 at 02:46 AM

From the experience of my current project, I set the collision detection mode of rigidbody to be Continuous, then the rigidbody does not fall through the mesh collider of a complex object underneath.

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

10 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

Related Questions

Rigidbody SweepTest doesnt work for mesh collider? 2 Answers

Catapult question 2 Answers

Rigidbody stuck in corners of Mesh Collider 0 Answers

How to allow collisions on a Child of a Non Kinematic RigidBody ? 1 Answer

Is there any way to improve collision detection accuracy with the mesh collider? 2 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