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 calbar · Sep 23, 2013 at 11:15 PM · collisioncolliderspherecorner

Why is my sphere collider only reporting 1 collision in corners? (pic)

Here is a top-down view of my sphere collider pushed into a corner of my environment mesh collider. It is only reporting one collision, and that is the collision with the north wall; the angled wall is being entirely ignored.

Only One Collision

If you continue to move the collider to the left, eventually the physics system kicks in and reports a second collision, but Unity seems to get confused and collisions with both walls will flicker on and off. Flat walls and corners with 90 degree angles work 100% of the time.

Please note that this is NOT a fast-moving rigidbody and I've tried every permutation of interpolation, collision detection, kinematic, and penetration penalty.

So, is this some sort of limitation on Unity's internal collision detection? Does it not like obtuse corners? Does it only check on fixed angles or something? Or have I not thought of something?

Thanks!

clipping.png (81.0 kB)
Comment
Add comment · Show 2
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 clunk47 · Sep 24, 2013 at 04:47 PM 0
Share

Are the walls mesh colliders?

avatar image calbar · Sep 29, 2013 at 07:52 PM 0
Share

Sorry for the delay, yes it is a single enclosed mesh collider. And actually, on that point, I even added thickness to the collider mesh, as someone suggested on IRC, but it didn't do anything to improve the detection.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by clunk47 · Sep 24, 2013 at 04:24 AM

If you're using OnCollisionEnter within a script attached to the sphere, that could be a problem because OnCollisionEnter only detects one collision at a time. Try using a script with each collider in your scene instead of just one on the sphere. This may not be what you're doing, but that's what it sounds like. If not, I'll remove this lol.

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 calbar · Sep 29, 2013 at 07:58 PM 0
Share

I was using both OnCollisionEnter and OnCollisionStay to funnel into a collision detection method that looped through all the collisions reported and did some math to push the object back. It worked beautifully on flat walls and 90 degree corners, but simply wouldn't report 2 collisions in the case posted here.

Interestingly, I've since switched to simply using vanilla rigidbodies and I've noticed that they, too freak out in this corner, so I'm thinking it's a limitation of Unity's physics implementation altogether.

avatar image
1

Answer by haim96 · Sep 24, 2013 at 08:05 AM

@clunk47, i think he not using OnCollisionEnter. unity physics should handle the collisions but it seems it miss the wall for some reason.

@calbar, can you try use capsule colider instead of sphere? you can align it in a way it will work the same as sphere from the top. i saw somewhere that the capsule works better than the sphere to detect collisions...

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 calbar · Sep 29, 2013 at 08:04 PM 0
Share

Unfortunately, I ditched this approach and ins$$anonymous$$d went back to using standard rigidbodies and smoothing out their jumpy motion. Wish I would have tried this, though, cause now I'm curious! Sorry about that, but thanks for your reply.

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

17 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

Related Questions

OnTriggerEnter is not running! Need help with collision. 2 Answers

How to set a boundary around an object? 1 Answer

Make a capsule collider BETWEEN 2 objects 0 Answers

Intersecting into inner corners of walls, when walking into them. 0 Answers

Trying to check area for game objects that collide with spawnpoints, then spawn an item where ever there is not a collision 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