Skip to main content
Skip table of contents

Set Component State

The set component state is a handy way of turning built in Unity components (Rigidbody, Collider, Mesh Renderer etc.) on and off through the graph. This is useful in many cases but some examples are, turning on a mesh renderer on a snap zone when you need to tell the user to snap an object somewhere, turning off a looping audio when a condition is met, or even turning off a collider.
Want to toggle on or off a script that isn't a Unity Built in one? Then use Set Behaviour State instead.

Setup

image-20240115-164724.png

A Set Component State Action Node

Follow these steps to set up a new Set Component State Action.

  1. Open a graph.

  2. Right click and Create a new Set Component State Action (Actions → Set Component State).

  3. Reference the Built in Unity Component you want to turn on or off.

  4. Set its state to be either on or off.

That's it. Now when a the action is called the chosen component will be set to the selected state.

For more information on the other inputs and outputs found on this node see Actions

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.