Introduction to collision
A collision is basically a point at which two objects come into contact with each other (for example, two objects colliding, an object hitting a character, a character walking into a wall, and so on). Most game development tools have their own set of features that allow for collision and physics to exist inside the game. This set of features is called a physics engine, which is responsible for everything related to collisions. It is responsible for executing Line Traces, checking whether two objects are overlapping each other, blocking each other’s movement, or bouncing off of a wall, and much more. When we ask the game to execute or notify us of these collision events, the game is essentially asking the physics engine to execute it and then show us the results of these collision events.
In the Dodgeball game you will be building, examples of where collision needs to be taken into account include checking whether enemies are able to see the player...