I’m learning how to use tilemap
. For now, i got 2 tilemap layers like ground
,obstacles
and player
gameObject (sprite). I want to destroy obstacles
when player
colide with them, so i got OnTriggerEnter()[ICODE] which [ICODE]Destroy()
colided object.
The problem is that colliding object is whole titlemap
(not just one obstacle).
My questions are:
- “Can I somehow delete only one elemnet (
tile
) intilemap
for example can i get onetile
position and replace thistile
withSetTile()
?” - Or maybe I should use simple
sprites
instead ofTiles
for ‘interactive’ objects. If so, how can i provide correct layers rendering i mean how can i force player sprite to rander ‘over’ obstacle ifplayer.y < obstacle.y
and ‘under’ otherwise?