OnCollisionEnter Vs. OnTriggerEnter — which one do I use?

Ethan Bristowe
2 min readApr 29, 2021

--

When to use OnCollisionEnter

The OnCollisionEnter() method is used for objects that you need to interact with other colliders physically, meaning that they will not pass through but bump into and block eachother’s paths.

An example of this is in a car game, when two cars hit eachother, they need to react to eachother physically. An equal force need to be given to both cars, a crash sound effect needs to be played, and they can visually show marks and dents from where the impact happened. All of this needs to happen OnCollisionEnter() so that they can physically bump and block one another. Otherwise they would pass right through eachother and none of the other components of the collision would make sense.

When to use OnTriggerEnter

The OnTriggerEnter() method is used for objects that you do not want to physically interact with other objects when colliding.

An example of this is a bullet in a shooter game, when a bullet collides with an enemy, I don’t want it to bounce right off or potentially block another object from moving, I only need it to trigger damage or any hit effects, and then either delete itself, or be able to pass through the enemy to potentially hit another behind it. So this would need to be OnTriggerEnter() so that this bullet can do everything it needs to do, without being physically affected by what’s colliding with it. Otherwise it can be blocked, bumped, bounced away and will no longer be going in the direction the player shot it.

--

--

Ethan Bristowe
Ethan Bristowe

Written by Ethan Bristowe

Passionate self taught game developer excited to learn and share everything I can about game development!

No responses yet