Push Button Interactions
To create pushable buttons in Meta Horizon worlds, it’s a common practice to use a Trigger Zone just above the button. When the player puts their hand in the Trigger Zone, it causes the world to behave as if they pressed the button.
This scenario looks like this:
Since web and mobile players don’t directly control their hands, it’s difficult for them to put their avatar within the Trigger Zone (unless they jump on it). To overcome this limitation, you can enable the setting Selectable in screen mode on the Trigger Zone:
- Open your creator menu and select Gizmos.
- Select Trigger Zone.
- Grab your Trigger Zone gizmo and move up on your right thumbstick to select ...Properties.
- Turn on the toggle next to Selectable in Screen Mode.
This image is taken from the Desktop Editor, but the same functionality is available in the Properties panel for entities in VR build mode. The Desktop Editor is only available to creators with access to advanced tooling.
The result enables web and mobile players to look towards the Trigger Zone and press E on web, or tap the button on mobile, to fire the OnPlayerEnteredTrigger event for that Trigger Zone.
This image is taken from the Desktop Editor, but the same functionality is available in the Properties panel for entities in VR build mode. The Desktop Editor is only available to creators with access to advanced tooling.
Note: If you place your
Trigger Zone inside or behind a collidable object, the collider will prevent web and mobile users from interacting with it. When you set a trigger to
Selectable in Screen Mode, make sure the trigger zone is bigger than the object, or turn the object’s collidability off.