Adding UI elements to the game world
A screen-shaped gaze-based menu is the very tip of the iceberg in terms of UI in VR; the lack of any actual screen creates a myriad of opportunities for interfaces directly integrated into the world, limited by just your creativity instead of the pixel count of the player's monitor.
In this section, we'll add some complexity to our dynamic wall mechanic and add some interface elements to them in the process. Specifically, we're going to make the walls expand upward in a unique color based on the player's team and make players able to shoot through walls that match their team's color. We're also going to make the walls collapse when players on other teams lower their health enough, which will be displayed in a dynamic bar on top of them.
Adding complexity to the dynamic walls
The first thing we'll do is make all walls start down by default. Open your DynamicWall script and edit the isRaised
variable to be initialized as false
:
public class DynamicWall : MonoBehaviour...