Animated tiles in Unity 2D

Daniel Kirwan
3 min readAug 25, 2021

Objective: Show how to create animated tiles in a Unity 2D game

First, make sure your project is in 2D. Then go to this link https://github.com/Unity-Technologies/2d-extras and find the correct version of the repository for your version of Unity. If you import the wrong version there will be errors that you cannot get rid of.

Once you have imported the extra 2D scripts, it will give you access to create an animated tile. For myself in Unity 2019, the new option is at the top when trying to create something new in the project folder. For others, the animated tile could be at the bottom.

This will create an animated tile asset in your project assets. I have three different animated tile assets I need to create so I made three of these new assets and labelled them accordingly, left, center and right waterfall.

The next part is the slow section. Click on the newly created asset and you will see an option to add the number of sprites for the animation. I have 30 in each of my sheets. Here is where it gets slow, you will need to add in each sprite from the sheet individually to the correct position.

Once you have added the sprites to the animated tile asset, you can drag the asset into the tile palette you wish to use for the animation.

Now you can add the animated tiles to your game as any other tiles. If you press play now, you might find that the animation is moving very slowly. This could be that the number of frames per second haven’t been set correctly in the animated tile assets.

You will just need to set the number of frames per second that your animation needs to be played at, mine needs to be 30. Below is the final result of the waterfall animation.

And that is it for adding in animated tiles to your 2D game in Unity.

--

--