Skip to content

Set Component Enabled ​

Show / hideBehaviour.SetEnabled

Enable or disable components (Light, Animator, AudioSource, UdonBehaviour, ...).

Turns components with an enable checkbox on or off: Light, Animator, AudioSource, UdonBehaviour and so on. Use it to stop just a light or an animation without hiding the whole object.

A disabled component no longer gets its per-frame Update. It is the same as the checkbox next to the component's name in the Inspector.

It changes only on the screen where the action runs. To keep everyone in step, react to a synced variable with On Variable Changed and run this action there (The same state for everyone).

Official docs: Behaviour.enabled (Unity)

Settings

NameTypeDefault
TargetsBehaviour list
OnOn/Offtrue

On a card

WhenInteract⋯
What to do
Set Component Enabled⋯
TargetsNone
OnOn
+ Add what to do

In Udon

Roughly this code, once per target ({ } are the settings):

{targets}.enabled = {enabled};

In the same category