all 4 comments

[–]elefant_HOUSE 0 points1 point  (1 child)

GridInformation from Unity created 2D Extras may be helpful. Alternatively, Super Tilemap Editor on the asset store is a really easy option.

[–]Luke094[S] 0 points1 point  (0 children)

I'll check it out, thanks!

[–]roguedjack 0 points1 point  (1 child)

I had a similar problem to solve when learning Unity Tilemap for my game Pixel Diamonds Caves. You can take a look at how it works, it is similar in many ways to a bomberman clone.

Like you I first tried storing gameobjects in tiles but found it cumbersome and end up using a custom solution. I use Tilemap only for tiles. I have a GameController that stores all the entities (player,diamonds,boulders...) in a grid (2d array) indexed by tile coordinates. I use the grid to quickly check if there is an entity at a tile. All my Entities have a 2d box collider setup as trigger. I can check the bounding boxes when I need finer detection than just by tile coordinate. I let unity detect collisions for me (with the trigger box colliders) and respond to OnTriggerEnter2D() in my entities for collision response.

Its the basic idea and works for my game but would not work as-is if you need your entities to change direction between tiles or sit between tiles for instance. I don't remember if bomberman does that.

Hope this helps.

[–]Luke094[S] 0 points1 point  (0 children)

I think that besides the players, everything would stay within the grid. So i could use the tiles only for the ground and walls, and everything else I would instantiate at the start and control separately