Scripted Animations

Another method for animating our sprites is through scripted or programmable animations. By writing a script that controls a set of movements or transforms, you can add animations that can complement other elements. For example, we can script a platform that moves back and forth for our character to jump to.

This method of animating has many uses, such as reusing the same script on other GameObjects and editing values almost instantaneously. We will deal with scripting in greater detail in the next chapter, but we will see this briefly used further along in this chapter.

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.