Enabling or Disabling Components – Unity3D Bolt Micro-Tutorial

This entry is part of a series of tips I am creating as I make my game.

You can use Bolt for free by downloading it from the Asset Store.

Details

What we need: A GameObject with a component we want to disable (in this case, an Animator component)

Input: A GameObject.

Output: The GameObject, but now the component is disabled.

How this saves you time: It’s not terribly obvious in Bolts documentation how to disable a component, a common task.

Summary: This tutorial shows you how to disable a component on a GameObject in Bolt.

Output

How to Implement

Here is an example of the completed Flow Graph:

In Bolt, each component gets its own Set Enabled component that takes the output of a Get Component. For example, if you wanted to disable the Box Collider of a GameObject then you would use the following instead of Animator Set Enabled:

Just make sure you update the Get Component to obtain a Box Collider as well.

If you need to deactivate a component that is on a different GameObject, change the Self to reference the GameObject in question:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: