Learning Unreal Engine Game Development
上QQ阅读APP看书,第一时间看更新

Adding Player Start

For every game, you need to set where the player will spawn. Go to Modes | Basic | Player Start. Click, hold, and drag Player Start into the viewport.

This screenshot shows the Modes window with Player Start:

Place Player Start in the center of the ground or slightly above it as shown in the following screenshot:

Deselect Player Start by pressing the Esc key. The light blue arrow from Player Start indicates the direction in which the player will spawn the game starts. To adjust the direction that the player faces upon spawning, rotate Player Start until the light blue arrow points in this direction. Take a look at the following tip on how to rotate an object.

Useful tip – rotating objects in a level

To rotate an object in a level, we use the Rotate tool to rotate objects around the x (row), y (pitch), and z (yaw) directions. Select the object and press the E key to display the Rotate tool. Three lines with a box tip will appear to extrude from the object. Click and hold the red arrow to rotate the object around the x axis, the green arrow to rotate it around the y axis, and the blue arrow to rotate it around the z axis.

Another way to rotate an object more accurately is by controlling its rotation through the actual rotation values found under Details. (Select the object to be rotated to display its details). In the Transform tab, go to Rotation, and set the X, Y, and Z values to rotate the object. There is an arrow next to Rotation that you can click on to select if you want to adjust the rotation values for Relative or World. When you select to rotate an object using the Relative setting, the object will rotate relative to its current position. When the object is rotated using the World setting, it will be relative to the world's position.

If you want the player controller (as shown in the preceding screenshot) to have the light blue arrow facing inwards and away from you, you will need to rotate the player controller 180 degrees around the y axis. Enter Y as 180 under the Relative setting. The player controller will be rotated in the manner shown in this screenshot: