Unity3D Basics — Driving Head-First into Collisions

Example:

the Enemy Collider has been set to trigger.

Say you want to create a dungeon adventure game where your player must face many traps. One of such traps might be a swinging log. In order to set off the trap, the player steps into a Trigger — a Collider in the game world that has no effect on the player’s position or movement. It does, however, make use of OnTriggerEnter() method to set off the trap. The log comes swinging down and collides with your player. The OnCollisionEnter() method can now be used to apply force and direction to your player based on the point in space where they both collided.

Experienced digital artist, Unity game developer & coder with a knack for problem solving and a passion for video games.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store