To use scripts to control 3D animations, perform the following steps:
- Start a new 3D project and ensure you are logged in to your Unity account in the Unity Editor.
- Since we're going to be moving our character around the scene, let's get rid of the fixed main camera and use the AI-controller camera rig from Standard Assets, so our character is always in view. Delete the main camera.
- Tag the Carla GameObject with the preset tag Player.
- Add to the scene an instance of the multi-purpose camera rig from Standard Assets. Drag the Prefab asset file, MultiPurposeCameraRig, into the Hierarchy window from the Project panel folder: Standard Assets | Cameras | Prefabs.
Now, when you run the Scene, the camera should smoothly reposition itself above and behind the player's character.
- Select the Carla Animator Controller in the Project panel.
- Simplify the state names in our controller. In the Animator panel, rename the HumanIdle animation...