- Home /
Sprite collision with Tilemap
I can't make my sprite collide with a tilemap.
The Sprite has a BoxCollider2D and a Rigidbody. The tiles on the tilemap have a collider set to Sprite. All that happens is the Sprite is directly above the tiles, and I was expecting them to fall and stop on the tiles. But instead, they clip right through.
Both Sprite and tilemap are on the sorting layer Test, with the order of 0.
If anybody knows the answer to this question, can you please respond as soon as possible? I have a deadline. @Cherno you're smart, I'm sure you can help please...
Do I need to make the Sprite an GUI Image? Or what do I have to do? I will do anything to finish this before June 1.
Answer by SoshJam · May 13, 2018 at 06:46 PM
I got it. Make all the tiles summon an invisible box the size of the tile, give it a collider, do the same to the falling thing, and kablammo!
Answer by aaklien16 · Aug 20, 2020 at 07:05 PM
The colliders on the tiles won't actually be applied unless to you add a component called the Tilemap Collider 2D (found in "Tilemap" section of Add Component menu) to your tilemap.
Your answer
Follow this Question
Related Questions
How do I make an object stick to all other objects (2D) 2 Answers
2D Collision Between Sprites 0 Answers
2D Sprite Collision with 3D Object 1 Answer
Sprite Collision with Tilemap with 3D Colliders? And would just using 3D walls be as good or worse? 0 Answers
Generate Tiles Programatically Over Player Position? 0 Answers