Learn how to use NodeCanvas

The Reflection 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 Tasks to interact with them in an efficient way. Following are the Reflection Tasks included.


Execute Function

This Action will allow you to Execute a Function that takes none or up to six 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 in 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 totally control 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 to 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 to a 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 non-void function with up to six parameters and check it directly against a given value.

Check Property


This Condition will allow you to check any property against a given 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 System.Action 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 one frame.

Yes No Suggest edit
21 of 24 users found this section helpful
Suggest Edit