Constructing gameplay boundaries

In the game, our player will battle for their life from a stationary position. The scene is a typical unrealistic Hollywood back alley, which sits at the junction of three pathways. Every few seconds, a zombie will be spawned in one of the pathways and the creature will then move toward the player.

We need to create an environment that facilitates the zombie action while also focusing the player's attention on the task at hand. In the following steps, we will construct the scene elements needed to facilitate our gameplay. A ground plane and several cubes will be used to define boundaries for the gameplay:

  1. Create an empty GameObject called Environment. Make sure it is sitting at 0,0,0.5.
  2. Add the following objects from the GameObject | 3D Object menu to the Environment GameObject and transform them, as indicated in Table 5.1:

 

Position

Rotation

Scale

Type

Name

X

Y

Z

X

Y

Z

X

Y

Z

Plane

Ground

0

0

22.5

0

0

0

6

1

6

Cubes

Left 1

-16

2

8.5

0

42

0

44

4

0.1

Left 2

-18

2

15.8

0

40

0

40

4

0.1

Left 3

-2.7

2

23

0

90

0

40

4

0.1

Right 3

2.7

2

23

0

90

0

40

4

0.1

Right 2

18

2

15.8

0

140

0

40

4

0.1

Right 1

16.37

2

8.85

0

137

0

44

4

0.1

Table 5.1: GameObject attributes

Figure 5.4 is a screenshot of the scene which illustrates the layout so far. Feel free to tweak the environment to meet your needs. In our example, we have positioned the shooting alleys so that the action takes place in a 110° arc. This will allow for quick motions while limiting the effects of motion sickness for the VR player. The topic of combating motion sickness will be discussed in more detail in the next chapter.

In this image, we've set the Shading Mode to Shaded Wireframe to help differentiate each of the GameObjects. This will be helpful later when the atmospheric conditions are set:

Figure 5.4: The scene environment (in Shaded Wireframe mode) including project folders

With the boundaries in place, we can test the environmental setup via the OVR camera. Hit the Play button (Ctrl + P or command + P) and put on the Rift headset to enter the scene.

  1. Adjust the environment as needed.
  2. Save the Scene.
..................Content has been hidden....................

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