Toggle Component Enabled
Show / hideBehaviour.ToggleEnabled
Flip components (Light, AudioSource, ...) between enabled and disabled.
Flips components such as lights, audio sources, Animators or other UdonBehaviours: enabled ones become disabled and the other way round. The object itself stays shown. To set a definite state, use Set Component Enabled.
It flips them only on the screen where the action runs. To keep everyone the same, toggle a synced variable and, in On Variable Changed, put the variable into Set Component Enabled (The same state for everyone).
Official docs: Behaviour.enabled (Unity)
Settings
| Name | Type | Default |
|---|---|---|
| Targets | Behaviour list |
On a card
WhenInteract⋯
What to do
Toggle Component Enabled⋯
TargetsNone
+ Add what to do
In Udon
Roughly this code, once per target ({ } are the settings):
{targets}.enabled = !{targets}.enabled;