1. First you need to import the VRGUI package into your project.
2. Now you need to create a script for your GUI that extends from VRGUI and implements the OnVRGUI method:
- Code: Select all
public class ExampleMenu : VRGUI
public override void OnVRGUI()
GUILayout.BeginArea(new Rect(0f, 0f, Screen.width, Screen.height));
if (GUILayout.Button("Click Me!"))
3. Now you need to add this script as a component of your player:
- You can attach it to the camera and it will follow your eyes, or
- You can attach it to your player controller and it will follow your player
4. You can choose to have the GUI displayed on a flat surface or a curved surface (the "Use Curved Surface" field)
5. You can choose where to position the GUI (the "GUI Position" field)
6. You can choose how much to scale the GUI (the "GUI Size" field)
7. You can choose to let the GUI accept mouse and keyboard events (the "Accept Mouse" field)
I have included an example project that shows a very simple implementation of a menu and a HUD. Hope this helps!