Movement by animation

This is probably the simplest approach to make a character or obstacle move, although it's still very useful and practical if we don't need a complex movement system.

In the previous chapter, we created a sprite animation for the coin where we added a different sprite for each frame of the animation and, at the end, we saw the coin spinning. Well, here we'll be using the same animation tab, where it contains a timeline, but the way we create the animation will be completely different:

Let's start by selecting the object that we want to animate. For this example, we have chosen a piece of the floor sprite, to create a ...

Get Learning C# 7 By Developing Games with Unity 2017 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.