Unoverlapable speite

How can you make a sprite that you can’t overlap like how a wall you can’t go through or go over a tile?

You can turn on the sprite’s “ghost through sprites” to disable overlaps with the sprite maybe.