Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animated tile loop question

Discussion in '2D' started by Snaiq, Apr 2, 2021.

  1. Snaiq

    Snaiq

    Joined:
    Mar 22, 2018
    Posts:
    2
    Hey,

    I have animated tile that has 7 frames (2d tile). It's a spell effect, and I want it to play one loop after key press.
    Previously I have used an animation event trigger on last frame, when working with regular sprite animations, but 2d animated tile doesn't seem to have one.

    I tried to create a timer, when the timer is up, it deletes the tile and it kind of works. The problem is that the animation seems to start at wrong frame sometimes. Im pretty sure that the reason is that my tilemap syncs all animated tiles, so when I press the key and the tilemap is on 3rd frame, it starts my animation from 3rd frame. (I have tried tilemap modes as chunk and individual)

    any ideas how to start the animation always from frame 1?
     
  2. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    that means that you would have to delay your spell and only start the animation when the tilemap cycle is on frame 1. are you okay with that?

    you are better off using spriterender and animator for that