Animating the Text Box text

Now that we have our layout set up, we can animate our text. To do this, we will need to create a new script. This script will control the animation of the text as well as load the next scene when all text has displayed.

To create animated text that looks like it's typing out, complete the following steps:

  1. Create a new C# script called AnimateText.cs.
  2. We will be writing code that accesses UI elements as well as code that implements scene loading. Therefore, we need to include the following namespaces at the top of our new script:
using UnityEngine.UI;using UnityEngine.SceneManagement;
  1. Now, let's begin our variable declaration. We'll create three lists that hold our Canvas Groups, Text display objects, and the ...

Get Mastering UI Development with Unity 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.