Collider trigger vs collision

Hi All,

I have 2 objects and and 2 colliders attached to each one of them.

If I want to detect a collision what should I use? the Trigger mechanism (i.e OnTriggerXXX) or Collision (e.g OnCollisionXXX) ?

I've been trying to figure the all issue of collision for couple of hours now and I'm still confused. Can U help me please?

1 Answer

1

I think you answered your own question...if you want to detect collisions, then use OnCollision. OnTrigger is for triggers, which don't cause collisions.

Thank u for your answer. But I don't get it...what do u mean by triggers which don't cause collisions?

That's not what I said. Triggers don't cause collisions, at all. That's why they are triggers.

Oh...Now I see...Thank u :)

This is not quite true. They will not interact with each other physically, but they will certainly cause a collision. Hence the reason you can pass the collision to the function as an argument.

@raybarrera: No, triggers do not cause collisions, and you can't pass a collision to the function as an argument. You can pass Collider, not Collision.