Book Image

Unreal Engine 4 Virtual Reality Projects

By : Kevin Mack, Robert Ruud
Book Image

Unreal Engine 4 Virtual Reality Projects

By: Kevin Mack, Robert Ruud

Overview of this book

Unreal Engine 4 (UE4) is a powerful tool for developing VR games and applications. With its visual scripting language, Blueprint, and built-in support for all major VR headsets, it's a perfect tool for designers, artists, and engineers to realize their visions in VR. This book will guide you step-by-step through a series of projects that teach essential concepts and techniques for VR development in UE4. You will begin by learning how to think about (and design for) VR and then proceed to set up a development environment. A series of practical projects follows, taking you through essential VR concepts. Through these exercises, you'll learn how to set up UE4 projects that run effectively in VR, how to build player locomotion schemes, and how to use hand controllers to interact with the world. You'll then move on to create user interfaces in 3D space, use the editor's VR mode to build environments directly in VR, and profile/optimize worlds you've built. Finally, you'll explore more advanced topics, such as displaying stereo media in VR, networking in Unreal, and using plugins to extend the engine. Throughout, this book focuses on creating a deeper understanding of why the relevant tools and techniques work as they do, so you can use the techniques and concepts learned here as a springboard for further learning and exploration in VR.
Table of Contents (20 chapters)
Title Page
About Packt
Contributors
Preface
12
Where to Go from Here
Index

Adding an interactive UI


Now it's time to give ourselves a way to change our companion pawn's state. To do this, we're going to add a widget component to our player pawn, along with a widget interaction component we can use to interact with it:

  1. In the Content Browser, find the location of BP_VRPawn—our player pawn.
  2. In the same directory, create a UI | Widget Blueprint, and name it WBP_CompanionController.
  3. Save it and open it.
  4. In its Designer window, change Fill Screen to Custom as we did with our previous widget.
  5. Set its size to Width=300, Height=300.
  6. From the Palette, select Panel | Vertical Box, and drag it onto your Hierarchy as a child of the Canvas Panel:
  1. Set its Anchors to fill the entire panel by selecting the lower-rightmost option (in addition to managing placement rules, anchors can also manage stretching rules):
  1. Set its Offset Left, Offset Top, Offset Right, and Offset Bottom to 0.0.
  2. From the Palette, select Common | Button, and drag it onto the Vertical Box. Name it btn_Follow.
  3. Drag another...