How to add “Physics” in Unity

Micah Tom
2 min readJul 19, 2023

--

Objective: Learning how to add “Physics” to our game objects

In this article. we’re going to learn how to make our laser collide with the enemy and damaging it as well as having the enemy damage our player.

If you click on a game object, you’ll notice that they have “Colliders” which detect any collision in the game.

However, this is not enough because we need to enable Unity’s “physics” system.

no physics properties added

This is where a tool called “Rigidbody” is needed, as it let’s us add physics properties to an object.

Now there are two types of collisions: hard surface and trigger collisions

For example, if you throw a ball at a wall it’ll bounce off the wall and back to you. That’s a “hard surface” collision. A “trigger” collision happens when you pass through an object in a game, like a power up item which you can obtain for your player.

With that said, we will want to activate the “Is Trigger” option on all of our game objects. Meaning the enemy, laser, and the player.

activating Is Trigger for gameobjects

In the next article, we’ll determine which gameobject will get a rigidbody. Also, we’ll get into “OnCollisionEnter” and “OnTriggerEnter” and how to use them.

Until next time my fellow game-devs!

--

--