Importing and animating the background
In this section, we are going to get familiar with Unity's Animator Controller. We will make our player's ship travel at lightspeed (well, give the impression that it is, anyway) by creating a fast-moving background of stars and particles (yes, that's right, more particles) at the start of the level, then we'll slow everything down when there are enemies up ahead.
Before we start animating at "lightspeed," we need to prepare the Hierarchy window:
- In the Hierarchy window, right-click on an open-space area.
- Select Create Empty from the dropdown.
- Click on the new game object and rename it
GameSpeed
. - Do this again and name the second game object
_SceneAssets
. - Drag
GameSpeed
onto the_SceneAssets
game object. - Make sure both game objects' Transform property values are set to Reset.
- Finally, drag the
_SceneAssets
game object from the Hierarchy window into theAssets/Prefab
Project...