Unity Guide

Introduction to Physics in Unity

A quick guide about basic Physics in Unity

Hard surface collisions

This type of collisions are the ones we see everyday in the real world. When we kick a ball, when a coin falls and bounces off the solid floor, when a boxer hits an opponent and knocks it out and every collision that applies forces between objects.

Trigger collisions

These are collisions we usually see in games where a player needs to collect items (coins, power-up, etc.) and when it touches them they disappear from the scene. This type of collisions doesn’t need a physics force feedback when they happen.

Start physics system implementation

Following the space shooter prototype from older posts, we need to have a enemy with behavior to attack from above, just like we did with the player and the laser behavior, so I’m going to suppose that we already have the enemy like this in the scene:

Unity physics system is not enabled yet.
  • Add a rigidbody to the laser and the enemy. Then disable the Use Gravity option as we don’t want the gameobjects to fall in the scene.

A passionate computer technology engineer and Unity developer that is always looking to grow in every aspect of life :).