ParelVRDocs
Player site

Creators / Worlds

World Menu

Your world's own menu, right inside ParelVR's main menu. Toggles, sliders, buttons and pages, in ParelVR's own style, with no code needed.

While players are in your world, your menu's icon sits in the main menu's top bar. They open it and see your pages: lights on or off, music volume, which outfit the DJ booth wears, game settings, anything you like. Each player has their own values.

Make one#

  1. ParelVR SDK > World > Create World Menu (or add the ParelVR World Menu component to an object).
  2. Give it a name and an icon (square, white on transparent looks best).
  3. Add pages, and fill them with controls.

A world has one World Menu. In the simulator, press M to open it.

Controls#

Control What players do Without code, it can
Toggle Switch something on or off. Show objects while it's on (or while it's off).
Button Press it. Switch objects on and off with each press.
Slider Pick a value between a minimum and a maximum. Set the volume of sounds.
Options Step through a list of choices with arrows. Show one object per choice.
Page link Open another page.
Label Read it: a heading or a note.

Each control has an id (scripts name it by this), a name, an optional line under it and an optional icon. Sliders can show a unit such as % or m, or show 0 to 100 whatever their range.

With scripts#

When you need more than switching objects, VoltCS hears every control:

using ParelVR.Volt;
using ParelVR.Volt.Audio;
using ParelVR.Volt.Objects;

public class PartyControls : VoltBehaviour
{
    public VoltGameObject discoBall;
    public VoltAudioSource music;

    public override void OnWorldMenuToggle(string id, bool on)
    {
        if (id == "disco") discoBall.SetActive(on);
    }

    public override void OnWorldMenuSlider(string id, float value)
    {
        if (id == "tempo") music.Pitch = value;
    }
}

The events are OnWorldMenuButton, OnWorldMenuToggle, OnWorldMenuSlider and OnWorldMenuOption. VoltWorldMenu reads and sets values (GetToggle, SetSlider, ...), changes names and descriptions, hides controls or greys them out, and opens the menu on a page. All of it is in the UI API.

Checks#

The world check catches missing ids, two controls with the same id, page links to pages that don't exist, and a second World Menu (from a copied object or a subroom), with an Auto Fix.