Question about Collisions and Triggers (Beginner)

Hi,

I have a question about Collisions and Triggers (am new to Unity and I am doing a few tutorials) that I can’t wrap my head around.

Description of what I have made so far:

I drew a simple pool table and have two spheres on it (both are RIGID bodies). Ball A can move via the control pad and Ball B can only react to being hit by Ball A.

My Question:

If I set Ball B to “is Trigger”, Ball A will just roll straight through it. Now I understand that its a trigger and once both volumes overlap a trigger will be generated. However if I wanted the two Balls to collide (that is, one does not roll through the other) and still generate a trigger, what option would I have to use?

The reason I am asking is a lot of times in games two objects need to collide and when they collide something is triggered. For example: lets say I have a car racing game. When a car hits a next car you will get a physics reaction and it may trigger an event like GAME OVER. As you can tell the cars will hit but WON’t go straight through the other.

As just a bit confused as to why there is not a “Upon Collide Trigger is Trigger” option.

Just asking. Any sort of help will be appreciated.

Avin

You would use the OnCollisionXXX events.

Thanks Jos-Yule. Just to clarify, the “OnCollisionXXX event” is not an actual option you can click in the Inspector but is instead actual CODE you must write, right?

yeah, there are a whole list of OnCollision events OnCollisionExit, OnCollisionStay, OnCollisionEnter - i’d suggest reading the Physics Docs.

Thanks, it makes more sense now… thanks a lot mate