Book Image

Mastering Oculus Rift Development

By : Jack Donovan
Book Image

Mastering Oculus Rift Development

By: Jack Donovan

Overview of this book

Virtual reality (VR) is changing the world of gaming and entertainment as we know it. VR headsets such as the Oculus Rift immerse players in a virtual world by tracking their head movements and simulating depth, giving them the feeling that they are actually present in the environment. We will first use the Oculus SDK in the book and will then move on to the widely popular Unity Engine, showing you how you can add that extra edge to your VR games using the power of Unity. In this book, you’ll learn how to take advantage of this new medium by designing around each of its unique features. This book will demonstrate the Unity 5 game engine, one of most widely-used engines for VR development, and will take you through a comprehensive project that covers everything necessary to create and publish a complete VR experience for the Oculus Rift. You will also be able to identify the common perils and pitfalls of VR development to ensure that your audience has the most comfortable experience possible. By the end of the book, you will be able to create an advanced VR game for the Oculus Rift, and you’ll have everything you need to bring your ideas into a new reality.
Table of Contents (17 chapters)
Mastering Oculus Rift Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Defining player spawn points


Spawn points are represented as prefabs in any scene that a networked player can connect to. For our purposes, we want four different kinds of spawn point: one for the red team, one for the blue team, one for the yellow team, and one for the green team.

Create an empty game object in your Square_Day scene and name it RedSpawn. Position it so that it's in the center of the bottom floor of the red building, facing in the general direction of the doors:

Save the RedSpawn object as a prefab by dragging it from the hierarchy into your Prefabs folder. Repeat this process by creating GreenSpawn, YellowSpawn, and BlueSpawn prefabs for the other buildings. Also, add all of these spawns to the Square_Night scene.

Once your prefabs have been created, highlight each in the Inspector and add a NetworkStartPosition component to it:

In order for our NetworkManager component to use these, we need to change the spawn method. Back in our lobby scene, highlight the NetworkManager...