BLACKISH DEV BLOG Support
 

 

Unity: Triggers and Colliders

I just learnt an important lesson: If I want a collider to react with a trigger+rigidbody, the rigidbody has to move to cause any effect. If trigger+rigidbody are on a static object, the colliders run right through it without a beep…

Triggers and Colliders are a bit weird…
2 Triggers with no rigidbody don’t do anything at all.
Same goes for 2 Colliders with no rigidbody involved.
2 Colliders where one has a rigidbody attached will cause a Collision.
1 Collider+Rigidbody and 1 Trigger will cause a Trigger.
1 Trigger+Rigidbody and 1 Collider will also cause a Trigger.
1 Trigger+Rigidbody and a second Trigger will again cause a Trigger.

It doesn’t matter if the rigidbody uses gravity or is kinematic, BUT in all these cases the effect will only be there if the object with the rigidbody is moving

Bookmark the permalink. Follow any comments here with the RSS feed for this post. Trackbacks are closed, but you can post a comment.

2 Comments

    col000r on November 5, 2009 at 14:34 | Permalink

    just to mention it once more: If the rigidbody doesn't move, there's not going to be a collision!

    So if you move a Trigger into a static rigidbody with a collider, nothing will happen. (A very crude workaround would be to add a script to the rigidbody that rotates it by 0.000001 degree each frame… Yes, very crude… as I said…)

    Anonymous on February 24, 2011 at 13:29 | Permalink

    Thanks for the info. Had problems with my triggers today. I tried your approach and rotated the trigger witch was standing still. However the trigger event will only accrue now and then. Is this something you have experienced as well?

    Michael

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>