Search Unity

Getting control over animated tiles

Discussion in '2D' started by MarketingMark, Sep 14, 2019.

  1. MarketingMark

    MarketingMark

    Joined:
    Nov 21, 2018
    Posts:
    2
    Hi all,

    I have made an animated 2d tileset that I would like to use in unity. Each tile has a 12 frame animation. The goal is to make any tile play its animation once at random intervals of 12 frame multiples. Does Unity provide any utility to allow this?

    I have downloaded the 2d-extras package. It includes the Animated Tile prefab, but I can't find any means to control the animation. The tile class only seems to provide animation data to some global animator once.

    It might also be possible to make an animated and an unanimated version of the tile. These could then be swapped out in the tilemap. However, that would require looping over each tile (on screen) at least every 12 frames and storing twice the ammount of tiles. Could I create a script on the tilemap to do such a thing?

    Any suggestions/links to tutorials to aid me in my quest?

    Thanks in advance for any help provided ˸)
     
    Last edited: Sep 14, 2019