UI Selection Group
Updated
Makes toggles exclusive, like radio buttons.
- Type
comp-ui-selection-group- Script class
UISelectionGroupComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Panels and layout: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Radio buttons with a selection groupThree UI Checkboxes drawn as radio buttons and made exclusive by a UI Selection Group, which a Behavior script adds; the log reports the chosen difficulty.
Pick Easy, Normal or Hard: the others turn off and the log names your choice. Drag outside the panel to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(UISelectionGroupComponent); if (component) log(component.props);}