On Button Press
Function:
- The scenario linked to this Node will begin when the selected button on the VR controller is pressed.
Can be connected to:
- Nodes containing Flow inputs (Behavior, Action, Flow Controls, Events & Triggers).
Particularities:
- This Node cannot be used on its own. It has to be part of a chain containing a triggering Node, such as an On Start Canvas, Interactive Node, or Trigger Zone Node.
- The Controller dropdown allows you to select the Dominant or Non Dominant controller.
- The Button dropdown allows you to select the Primary (A or X) or Secondary (B or Y) button.
- The On Button Press output triggers the attached scenario when the selected button is pressed.
- This Node is currently supported in VR only.
Using the On Button Press Node
Example: Making a shape glow when pressing a controller button.
In order to recreate this scenario, you'll need to place these assets in your Space:
- A Canvas
- A Pentagonal Prism
Setting up the scenario:
- Add an On Start Canvas Node.
- Add an On Button Press Node.
- Add a Glow Node.
- Connect the Flow Out of the On Start Canvas Node to the Flow In of the On Button Press Node.
- Configure the On Button Press Node:
- Controller: Dominant
- Button: Primary (A or X)
- Connect the On Button Press output to the Flow In of the Glow Node.
- Add an Asset Reference Node and select the Pentagonal Prism.
- Connect the Asset Reference Node to the Asset input of the Glow Node.
- Configure the Glow Node:
- Start Intensity: 0
- End Intensity: 4
- Duration: 0
Testing the scenario:
Enter Play Mode and press the Primary button (A) on your dominant controller.
The Pentagonal Prism will glow when the selected button is pressed.