How to add ground collider to 2D environment

Let’s go over how to add a ground collider to 2D environment.

Select the tilemap with the ground tiles and add a tilemap collider:

Add a Composite Collider 2D which will also automatically add a Rigidbody2D:

Set the Rigidbody2D to Static.

Lastly, on the Tile Collider enable “Used By Composite” to have a collider only on the surface:

Good luck!