Kubaa322
Kubaa322

Reputation: 57

How can I collide a trigger and a non - trigger in unity 2D?

is there a way which I can collide a trigger collider and a non-trigger collider? I tried using different rigidbody types but it didn't really work. As you can see one of them has istrigger turned to true, the other one to false. Here's my colliders : image 1

image 2

Upvotes: 0

Views: 1734

Answers (1)

Giovanni Zambiasi
Giovanni Zambiasi

Reputation: 19

According to the Unity Collision Action Matrix, OnTrigger messages will be sent in case of a Kinematic Rigidbody Trigger collides with a Kinematic Rigidbody Collider: Trigger message matrix

However, OnCollision messages will not be called in this instance: Collision message matrix

i.e. OnTrigger Enter2D/Exit2D/Stay2D will be called, while OnCollision Enter2D/Exit2D/Stay2D will not. Also note that since your colliders are all 2D, you need to use the "2D" suffix on the collision functions.

Upvotes: 1

Related Questions