> For the complete documentation index, see [llms.txt](https://ms-kb.msd.unimelb.edu.au/next-lab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ms-kb.msd.unimelb.edu.au/next-lab/virtual-reality/guides/vr-development-overview/unreal-engine-overview/unreal-engine-other-guides/setting-up-a-vr-ready-file.md).

# Setting up a VR-ready File & Templates

## HTC Vive - SteamVR: Unreal Engine Template File

{% hint style="danger" %}
Unreal Engine is a Real-Time Rendering Engine. Meshes or objects with excessively high poly-counts require far more processing power to render. The use of needlessly high-poly meshes can often result in poor VR experiences. [Read more about VR asset preparation here.](https://medium.com/@Hales/keeping-it-canny-asset-preparation-for-virtual-reality-659d46001976)
{% endhint %}

This covers the basic setup using the pre-made Virtual Reality template file provided by Unreal Engine. It comes in with various additions that just need to be deleted. It allows for standing VR, motion controller-enabled VR and gamepad VR.

### Project Creation

1. Open Epic Games Launcher
2. Navigate to your preferred version of Unreal Engine and open it
3. Click `[New Project]` in the upper tab menu.
4. Under the `[Blueprint]` tab, select the `[Virtual Reality Template]`
5. Under the project options, set the device to *Mobile/Tablet. Desktop/Console* may be used but VR experiences are generally resource intensive, if the intended experience is not dynamically intensive it would be okay.
6. Set the quality to *Scalable 2D/3D. Maximum* may be used if the intended experience is not dynamically intensive.&#x20;
7. You may choose to import it with or without *Starter Content.*
8. *Create the Project.* Unreal Engine will now create your project.

### SteamVR

SteamVR will automatically open upon launching Unreal Engine. If it does not, open it through Steam or the system.

### VR-ready Level

The VR-template comes with two VR-ready maps.

1. In the *Content Browser,* navigate to `[VirtualRealityBP > Maps].`
2. Choose the level template you wish to use:
   * HMDLocomotion relies on the use of a gamepad (not included with MSD VR kits)
   * HMDMotionController has built in functionality with the Vive Controllers
3. Save a copy of this level to work from, `[File > Save Current As]` and save it to the root.
4. Delete all unneeded content from the *World Outliner***.** A standard base pictured below.
5. In the *Details* panel of `[VRPawn]`, ensure *Auto Possess Player* is set to **Player 0**. Also ensure that *Auto Possess AI* is set to **disabled.** This ensures that upon running the experience, the player's VR HMD will register automatically and not anything else.&#x20;

![Figure 3.0 - VR-Ready Maps](/files/-LYy4l7ULz4JwEpZEqzk)

### Unreal Engine Resources

Unreal Engine builtin resources can be accessed through the *Content Browser.* Under `[View Options > Show Engine Content]` and through the *Sources Panel.*

### Debugging, Testing and Playing

Use \[VR Preview] under \[Play] to simulate the experience in VR

## NExT LAB VR-ready Template

{% hint style="danger" %}
Templates are not compatible with all versions of Unreal Engine. This specific template is compatible for UE 4.22+
{% endhint %}

Download Link: &#x20;

This section covers using templates in general, along with a Virtual Reality template provided by the NExT Lab. It comes with basic environments set up with some basic assets included and a first person camera

### Using Templates

1. Navigate to the Templates folder of your preferred Unreal Engine version in the the Program Files. E.g: `C:\Program Files\Unreal Engine[Version]\Templates`
2. Unzip and copy the downloaded template to this `Templates` folder

### Project Creation

1. Open Epic Games Launcher
2. Navigate to your preferred version of Unreal Engine and open it
3. Click `[New Project]` in the upper tab menu.
4. Under the `[Blueprint]` tab, select the newly imported template.
5. Under the project options, set the device to *Mobile/Tablet.*&#x20;
6. Set the quality to *Scalable 2D/3D.*&#x20;
7. The template already has built in *Mobile* *Starter Content.*
8. *Create the Project.* Unreal Engine will now create your project.

### SteamVR

Foreword: SteamVR will automatically open upon launching Unreal Engine, if it does not open it through Steam or the system.

### Using the Template

The *World Outliner* already has set up folders and default content:

* 00\_SkyEnvironment includes a `[BP_Sky_Sphere]`, this is linked to the `[DirectionalLight]` in the same folder. You can rotate the `[DirectionalLight]` and toggle \[Refresh Material] in `[BP_Sky_Sphere's]` *Details* to set the sun location.
  * The \[EnvironmentSphere] can be changed by finding the attached \[m\_Environment] material and replacing the diffuse and alpha textures. *Content Browser: Environment.*
* The 01\_Player in the *World Outliner* includes a working VR-MotionController and a FirstPersonController. To use one or the other, find the setting `Auto Possess Player` in the *Details* panel. Set the one you wish to use to `[0]` and the other to `[Disabled]`. *Content Browser: Player.*
* 03\_Foliage contains some trees already, more can be found in the *Content Browser: Vegetation: Meshes.*&#x20;
  * Only the basic ones have been set up.
  * The grass can be accessed through the foliage tool.
* 04\_Effects includes atmospherics and visual effects. These can be adjusted in their respective *Details* panel.&#x20;
  * In Wind, the `[WindDirectioinalSource1]` controls the wind direction. This affects the Particles. *Content Browser: Particles.*
  * The sound file of *\[AmbientSound]* can be replaced.
  * Fog and PostProcessing can be adjusted in their *Details.*
