Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 testure · Sep 06, 2011 at 10:17 PM · triggermeshcolliderprecisionconvex

mesh trigger only triggers on intersection with mesh unless convex

What's the purpose behind this? When you mark a collider to behave as a trigger, it's no longer used in the physics system, so why is it that unity's triggering will only happen if you're intersecting the mesh? If you set the mesh trigger as convex, it works great- but then you lose tons of precision..

Am I missing something here? What do you do when you want an "L" shaped trigger, for example? Unity only allows you to add a single box collider to a game object.. are imprecise triggers the only way to go about it? That just seems... stupid. Assembling compound colliders in child objects and using them as triggers is a waste of time, since you'd also have to write a script that catches the trigger events on those game objects and reports back to the parent script.

Any ideas?

Comment
Add comment · Show 6
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 Waz · Sep 07, 2011 at 12:02 AM 0
Share

What do you mean by "intersection"? Surely triggers should be expected to fire when something intersects with them (in the sense that their solid forms overlap). You seem to be meaning something else.

avatar image Peter G · Sep 07, 2011 at 12:29 AM 0
Share

You're not moving the mesh collider are you?

avatar image testure · Sep 07, 2011 at 01:18 AM 0
Share

nope, it's static.

also @Warwick: I mean, when an actor/object/whatever is physically intersecting the mesh trigger's polygons. Essentially what happens is, you can run a character controller into a mesh trigger that is not set to convex- and the moment it intersects it triggers OnEnter, and the moment you finish walking through the polygon 'barrier' that makes up the trigger, it triggers OnExit- even though the correct behavior would be for OnStay to fire.

Hope that makes more sense.. I know it sounds weird- I've never run into this before as I've usually been able to get away with primitive triggers until now.

avatar image Waz · Sep 07, 2011 at 01:25 AM 0
Share

Ah, you mean "intersects with the surface". Sounds like a bug to me, I've certainly never seen that documented anywhere. You're certain your Normals are pointing the right way, I assume?

avatar image SisterKy · Sep 07, 2011 at 08:31 AM 1
Share

Please don't invent new tags unless really necessary =/ 'imprecise' (is a special case of) -> 'precision'; 'mesh trigger' (does not exist as such, but) -> 'meshcollider', 'trigger'. (if you don't use space or uppercase while typing tags, you should get a dropdown-list of already existing tags as soon as you type at least two letters) Thanks :) Greetz, $$anonymous$$y.

Show more comments

3 Replies

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

Answer by jonas-echterhoff · Sep 07, 2011 at 07:37 AM

I think this limitation makes sense from an architecture point of view, since calculating if a point is inside a concave mesh is very heavy computationally. For PhysX most common use of MeshColliders (handling collisions), only detecting collisions on the surface is sufficient. Anyways, as this is most likely a limitation in NVidia PhysX, you probably cannot get around it other then by approximating your shape with compound colliders.

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 Bunny83 · Oct 14, 2011 at 10:33 PM 0
Share

A $$anonymous$$esh actually doesn't represent a volume. It's just a collection of faces. A $$anonymous$$esh doesn't need to be closed, therefore there's not really an inside or outside. The collision is checked with each face / triangle. That's why they are very heavy and why $$anonymous$$eshcollider<-->$$anonymous$$eshCollider collisions are not possible. A convex $$anonymous$$eshCollider actually does represent a volume since it is forced to be closed.

+1

avatar image
1

Answer by UGTools · Oct 18, 2012 at 12:06 PM

Convex mesh collisions are, even if more expensive than primitive collisions, quite straightforward and simple to compute. Current physics engines don't support concave dynamic objects mostly due to the fact that they are so expensive to solve. This will change in the future (nvidia already has shown realtime fracturing and concave collisions) but right now it's the only way to go. Unity uses PhysX, which is no different regarding this limitations.

The way to go around this is to use compound colliders, which you've already mentioned. But you can use triggers and they will report to the parent object automatically, so even if you use 20 primitive colliders as children you still use the same trigger event on the parent.

We've developed a Unity3D component that automatically computes a compound collider for any given object. It supports trigger events, so even if there are many colliders the event still can be processed at the parent level through the OnTriggerXXX callbacks.

Here's the component: Asset store link

Here's a demonstration video: Youtube

And here's a screenshots comparing the standard convex collider with our concave collider:

alt text

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 diekeure · Sep 05, 2013 at 07:06 PM

I've created a small solution to this problem: a script together with an editor script that allows you to define a polygon together with a certain height. These polygons can be concave and work the same as normal physics triggers.

http://grrava.blogspot.be/2013/07/area-concave-triggers.html

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

11 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

Related Questions

Create hollow sphere with objects bouncing around inside 2 Answers

Strange Convex Mesh Collider Behavior 0 Answers

Why does my trigger-collider receive Enter but not Stay or Exit? 1 Answer

Problem with mesh collider 2 Answers

Convex NonTrigger Mesh Collider + Rigidbody = weird transform position 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