IN THIS ARTICLE
VR Islands Level
VR Islands Level
The VR Islands level (VR_Islands_Sample
) shows you how to create a simple VR level with the instantvr
entity and physics collision on controllers. This level features floating islands between which a player can teleport with the trigger button on the Oculus or Vive motion controllers. The player can hold the trigger button to pick the location and then release the button to initiate the teleport.
Note
This level uses Script Canvas and Lua for game logic.
Legacy systems have been replaced or removed, with the exception of the navigation mesh. The VR Preview component generates the navigation mesh, which is required for teleporting in gameplay.
This level uses an instantvr
slice that has the following child entities:
Controller_One
– Represents the player’s right hand.Controller_Zero
– Represents the player’s left hand.Camera
– Represents the player’s head.InvalidLocationSpawner
– Spawns an invalid location marker when the player teleports within the terrain or navigation mesh.ValidLocationSpawner
– Spawns a valid location marker when the player teleports within the terrain or navigation mesh.InputConfiguration
– Contains the input bindings for teleportation events.
For more information about installing the project that includes the VR Islands level, see Virtual Reality Samples Project.
Using the InstantVR Entity
The VR Islands level is created with the instantvr
entity, which has the following components:
- Lua Script – This component uses the
instantvr.lua
script for VR device tracking and teleportation functionality. You can find the script in thelumberyard_version\dev\VirtualRealityProject\Scripts\vr
directory. - VR Preview – This component automatically generates a 50x50 meter navigation area, and a navigation mesh within the navigation area. The navigation mesh is required for the
instantvr.lua
script to detect valid teleportation locations. Note
You must select the Static check box on the Transform component for all entities in the navigation area. This ensures that the navigation mesh generates correctly. The Static check box is cleared by default.
Using the HideOcean Entity
The VR Islands level includes a HideOcean
entity that allows you to hide the ocean when the level runs in VR mode.
To hide the ocean
Open the Console Variables window. For instructions, see Viewing the Console Window.
In the Console Variables window, search for the
e_WaterOcean
console variable.Set the
e_WaterOcean
console variable to 0.