Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TileMap where the tiles slide down and change position

Discussion in '2D' started by y3ht72ety812yg8912tg, Mar 1, 2021.

  1. y3ht72ety812yg8912tg

    y3ht72ety812yg8912tg

    Joined:
    Jan 6, 2021
    Posts:
    14
    I'm trying to make a similar mechanic to Card Fall https://play.google.com/store/apps/details?id=com.The717pixels.cardFall&hl=en&gl=US, the game basically has this grid (3x3) and the cells slide down, I wanna make them slide in different direction or even rotate.

    Do you think a TileMap is the right choice? I played around with it and having no fixed bounds for the TileMap is bugging me a little, I was thinking of maybe avoid TileMaps and simply place down gameObjects and somehow have references to their neighbours to make movements and other things easy.

    Is there any other approach? How do you think the developer of Card Fall implemented that sort of grid? (That game is made with Unity too)
     
  2. Derekloffin

    Derekloffin

    Joined:
    Mar 14, 2018
    Posts:
    322
    Tilemap isn't really worth it here. You're doing a lot of in between tile things, and there is only a relatively small number of tiles so you're not getting much in the way of efficiency from using the tilemap while also having to work around lots of its limitations. Better to just handle your tiles as discrete game objects. Now, you might want to have a tilemap as a guide during your development phase, but ultimately you'd be removing it from the final product as it is just there o ensure you get positioning right.