Wednesday, 23 November 2016
UI VR
Because you cant use standard GUI in VR (Virtual reality) text book UI (User Interface) and HUD (Heads Up Display) is flipped on its head.
Usually the canvas would be used to display the HUD such as menus, buttons, health bars or anything else the game designer feels appropriate. However because the canvas is always in view of the camera the HUD appears static no matter where the camera moves. This in VR can cause issues as static HUDs can cause simulation sickness.
The solution is not to have a standard 2D HUD at all and instead incorporate it into the 3D environment. For instance I decided to have my controller instructions and tutorial displayed on the TV in the environment. I then created a script to cycle through each image to display each step within the game.
The menus was more tricky. I couldn't use standard GUI button creation normally used for games in Unity. Instead I created 3D objects and box collider triggers. I then fire a raycast from the center camera. If the raycast hits the collider then the menu will activate.
However there was an issue with this method. The box colliders were too close together and the raycast would activate all buttons at the same time. I therefore decided to use one large trigger box which covered the entire menu. I then used different buttons on the xbox 360 controller to activate different menus. I created booleans which activate and deactivate when certain menus are activated. This helps prevent multiple menus activating at the same time when a single button is pressed.
For certain menus such as "how to play" I used multiple planes that are slightly rotated to help cover the peripheral vision, as well as help the player naturally look around.
For the pause menu in the main level I freeze the gameplay every time the game is paused. I make sure the game play is unfrozen both when resuming and when the player returns to the main menu. This not only helps the in game animations to continue, but also allows the light to bake as well.
I also used the fading script I created earlier but made the alpha freeze at 0.5. This helps tint the background making the menu more viable. I'm also playing a risk by attaching the pause menu HUD to the camera and therefore making it static. My hope is that the player wont be in the pause menu long enough for them to develop simulation sickness.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment