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
2
Question by blitzen · May 21, 2012 at 09:11 AM · collisioncollidermeshtriangle

Glitchy Convex Mesh Collider

I have an object shaped like an isosceles triangle:

When my engine moves it around by manually setting its position, it needs to collide with other objects as a trigger, most of which are simple box colliders with kinematic rigidbodies. I've given it a mesh collider, which without being marked as convex, works perfectly in colliding with everything except other triangles, since non-convex mesh colliders don't detect each other.

When I try marking it as convex and moving the triangle perpendicular to its width, it gets really buggy passing through a normal box-collider object, still thinking it's colliding well after it's passed through to the other side by a good 10 units or so. Other objects moving into the triangle work fine. The mesh has 208 triangles, within the 255-triangle limit imposed on convex mesh colliders, and I've tried setting its rigidbody's collision detection to continuous/continuous dynamic to no avail.

Creating umpteen child objects with long, rotated box colliders to fit the shape and fill in the end corners complicates my code just for this one case, introducing yet other bugs, but that's what I've ended up having to do.

I'm curious - are convex mesh colliders this buggy for everyone?

Edit: I've created a minimized sample project showcasing the issue; download it here.

Move the 3 triangles with the scroll bar at the bottom through the 3 boxes slowly, and notice the difference between the triangle with the convex mesh collider (on the left), the one with the non-convex mesh collider (center) and that of the box collider (right). Two of these things are kind-of the same; can you guess which one of these doesn't belong?

Looks like a submittable bug, no?

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 syclamoth · May 21, 2012 at 09:43 AM 0
Share

I haven't experienced this kind of problem before- how complex is the mesh? Does it have any exposed backfaces?

avatar image Bunny83 · May 21, 2012 at 11:14 AM 0
Share

$$anonymous$$eep in $$anonymous$$d that a convex meshcollider just consists of the convex hull of the whole object. It seems your triangle have a hole in the center, this won't exist in the collider. Convex means there is not even a small bump in the colliders surface. All suface angles are greater than 180°.

The next thing is you should attach the rigidbody to the moving objects. You don't need to use gravity / forces, just make it a kinematic rigidbody.

Btw. when you select your object you should see the generated meshcollider in the sceneview.

avatar image blitzen · May 23, 2012 at 07:43 AM 0
Share

The mesh is the shape in the picture above, with 208 triangles and no back faces that I know of. I just created a demo project showcasing it in my post above; see for yourself.

avatar image Bunny83 · May 23, 2012 at 02:10 PM 0
Share

Yes, this shouldn't happen ;) This is clearly a bug in the convex meshcollider. The needed distance to exit the collision is about the length of the object, but in the wrong direction ;) It's like the bounding box is a perfect cube.

I would definitely submit a bug report. You should explain exactly what is wrong and how to achieve the result. Your test scene is perfect.

Btw, it seems when you move the cube a little bit (maybe the $$anonymous$$-penetration-distance?!) while the collision is "stuck", the collision ends.

edit Just tested the other 3 directions and it's the same result. It really looks like a bounding cube

1 Reply

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

Answer by blitzen · May 23, 2012 at 08:09 PM

Submitted.

Good call regarding the bounding box, Bunny83. That's why it works fine moving side to side in the direction of its acute corners, but not forward/backward or up and down. Thus since it only happens when you pass all the way through to the other side, something's faulty in triggering OnTriggerExit() beyond checking its Collider.bounds.extents.

It also only seems to happen for small, narrow collision obstacles; if you scale the little rectangle up to about (5,5,5), it then works OK.

There's a good several days of my life for ya.

Comment
Add comment · Show 5 · 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 blitzen · Jul 25, 2012 at 07:03 AM 0
Share

They considered it a manifestation of another "known bug" in 3.5.2, yet two months later it still appears when you run the above example program in 3.5.4.

I wonder when they plan on tackling it, and it also brings into question just how many other known bugs they leave in the program each update.

avatar image blitzen · Aug 18, 2012 at 09:14 PM 0
Share

Their latest response is that it's slated for 4.0 and not any time in 3.5, so that answers the question of their policy on these things. One would only hope they don't leave any known bugs in major version releases.

avatar image blitzen · Nov 25, 2013 at 03:02 PM 0
Share

Whelp, running the example project above in 4.3, it looks like the bug is still there a year and a half later.

Good hustle, guys.

avatar image KieranSmart · Oct 23, 2014 at 05:10 PM 0
Share

I'm running the latest version 4.5 and this still seems to happen. Have you figured out a work around? I was thinking of creating several "planes" and hiding these within my object then giving them convex colliders but after reading this I'm not sure it will work. What are your thoughts?

avatar image blitzen · Nov 01, 2014 at 08:02 PM 0
Share

That's what it seems you'll end up having to do. Resorting to such increased the complexity of my engine several fold, and to this day, this has kept the relevant aspect of my project stagnant.

I wonder just how many of these known bugs they decide to just leave throughout several major releases.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Have a collider spit out any intersecting colliders to the closest next to them where there is no collision 0 Answers

player falling through walls of blocks in voxel game, collides with floor though. 0 Answers

Collision massively misplaced 0 Answers

I need help to mesh collision. 0 Answers

Edit WheelCollider's Axis, not the Mesh 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