Learn how to use NodeCanvas

Download PDF Version

The Script Control Tasks

NodeCanvas comes with various Tasks that allow you to make use of existing code and components on game objects, that are well worth mentioning.
By using these Tasks a whole lot of different actions can be performed that at the first glance you might think they are missing. Here are a few things that can be done for example by using these Tasks:

  • Translate an object
  • Change an object’s name
  • Check if a CharacterController isGrounded
  • Check if a RigidBody isKinematic
  • Send a Message to a game object
  • Stop an AudioSource
  • Set an AudioSource’s volume
  • and so on…

Furthermore you can keep all your implementations in your own scripts instead of creating custom action and condition tasks, and use these Script Control Tasks to interact with them in an efficient way. Following are the Script Control tasks included.


Execute Function

This Action will allow you to Execute a Function that takes none or up to three parameters on any Component/Script on the selected Agent and also able to save the return value of that function to a blackboard variable. The value to be used as the parameters can either be directly assigned or taken from blackboard variable.

This Action ends immediately in Success unless the function selected is an IEnumerator is which case it will be executed as a Coroutine! In this case, the action will be running and only return Success after the Coroutine is done.

Implemented Action


With the Implemented Action Task, you are able to totaly control for how long the action will run and what Status it will return. In essence it forwards the execution of the Task for a function on a script to control. That function must have a signature of public Status and take one or no parameters. For example:

Get Property


This Action will allow you to Get a property from any of the selected Agent’s components and store that property as a blackboard variable.

Set Property


This Action will allow you to set a property on any of the selected Agent’s Components.

Get Field


This Action will allow you to Get a field from script on the Agent and store it as  blackboard variable.

Set Field


This Action will allow to Set a field on any of the selected Agent’s components.


Check Function


This Condition will allow you to call a boolean function with no parameters and check it directly against a value

Check Property


This Condition will allow you to check a boolean property directly against a value, saving you from having to first Get it and then Check it.

Check CSharp Event


This Condition can be used to subscribe to an event of EventHandler type or custom handler with 0 arguments and return type of void. As soon as the event is raised, this condition will return true for that specific frame.

Yes No Suggest edit
19 of 20 users found this section helpful
Suggest Edit