Quick tip — Tilemap Colliders — Using Tilemap in Unity — part 4

In this quick article I will demonstrate how to set up colliders to a Tilemap.

Luke Duckett
2 min readSep 25, 2021

The first step is to add a “Tilemap Collider 2D component to the layer your player is going to interact with, in my case it is the “Ground Tilemap”.

On your game object click “Add Component” then search for “Tilemap Collider 2D”.

What you will notice is that all tiles on that layer will receive a collider around them, creating unnecessary collider points the player will never reach.

We can fix this by adding another component called “Composite Collider 2D”. Adding this component will automatically add a Rigidbody 2D component to the game object. Ensure to set the Tilemap Collider “Used by Composite” checkbox to true.

This will then set the collider to the outside edges of your tilemap.

That’s all for now.

--

--

Luke Duckett

🎮 First Nations Unity Dev from Wonnarua country 🏞️ | From Player to Lifelong Learner: Crafting Games, Debugging Code, and Embracing New Technology