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

Animated Tiles: only show animation once on collision

Discussion in '2D' started by mvriel, Jan 22, 2018.

  1. mvriel

    mvriel

    Joined:
    Mar 17, 2015
    Posts:
    13
    To try out the new Tilemap feature of Unity I wanted to make a Super Mario Bros. clone. Most of what is in the original can be implemented splendidly with it. I am hitting one snag: the question mark block.

    What I am trying to accomplish is that the animation for a tile only runs once and is triggered by an external influence. Thus, when Mario bumps the question mark block it should play its animation and stay still in the last sprite of the sequence.

    So far I have tried to override the GetTileAnimationData and GetTileData but this did not have an effect. I must admit that the lifecycle of the methods in the TileBase class is not apparent to me; I am assuming that these methods are only called when a refresh of the tile happens.

    I hope someone here knows more about this and how you could accomplish such a feat.

    Thanks in advance
     
  2. mvriel

    mvriel

    Joined:
    Mar 17, 2015
    Posts:
    13
    I was hoping there would be someone well-versed in Tilemap animations around; perhaps now?