Working with Unity's standard asset package

The game character, the player character, the user-controlled player—these are all terms that are used to refer to our game's main character, the Cucumber Man, which the human player will control. In Unity, we refer to this as the player character. In order to have a player character, we need a controller. In our case, we will use a third-person controller. A third-person controller is a framework used to control a character from the perspective of a third-person camera.

The Unity standard asset package includes a ThirdPersonController asset package. The package, as you can see in the following screenshot, contains Animation, Materials, Models, Scripts, Textures, and Prefabs:

This section demonstrates how to use a character created by Unity. It will not be incorporated into the Cucumber Beetle game. By going through the following steps, you will become familiar with the process of using the ThirdPersonCharacter provided by Unity:

  1. Launch Unity.
  2. From the top menu, select Assets | Import Package | Characters
  3. You will be presented with the Import Unity Package dialog window. Click the Import button.

 

  1. In the Project panel, you will see Standard Assets. Navigate to Standard Assets | Characters | ThirdPersonCharacter | Prefabs and drag the ThirdPersonController prefab to the Hierarchy panel. 
  2. Double-click on the ThirdPersonController in the Hierarchy panel to autofocus on the controller in the Scene view. As shown in the following screenshot, the character is encased in a capsule controller: 
  1. In the hierarchy pane, drag the Main Camera so that it is subordinate to the ThirdPersonController. This is required so that the camera follows the player character during gameplay.

 

  1. In the Scene view, use the transform tools to position the camera above and behind the character. With the camera selected, your Camera Preview window, in the Scene view, should look similar to the following screenshot:

Now you can put the game into game-mode and navigate the game world using your keyboard and mouse. As you will see, the default character can move around the world, and the camera will follow.

Using the provided ThirdPersonController is great for testing purposes, but you would not want to deploy a game using these standard assets. Although Unity Technologies permits commercial use of their standard assets, using them erodes the uniqueness of your game, so it is recommended that they only be used for testing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset