Documentation

Learn how to use NodeCanvas

Download PDF Version

Creating Custom Tasks

NodeCanvas is built around the concept that the nodes of the graph are responsible only for the flow and not what and if it happens. Tasks are responsible for that and thus there are two kinds of Tasks those being Action Task and Condition Task. Tasks are assigned to nodes that require them and thus Tasks can be reusable between different types of systems. This concept allows to decouple the graph design from the actual implementation of actions or conditions thus allow for a non-destructive workflow.

Action Tasks

In short, to create an Action Task you must derive from the ActionTask base class and override the virtual methods as needed. When the Action is complete you must call EndAction(bool) to end the Action either in success or failure depending on the bool argument passed and that’s it!

Following is the core API that you can use to create your own action tasks.

Examples

A simple action would be like this:

A simple delay would be like this:

Condition Tasks

In short, to create a Condition Task you must derive from the ConditionTask base class, override the virtual OnCheck method and return the result.

Following is the core API for creating custom condition tasks:

Examples

A simple condition example.

Yes No Suggest edit
15 of 16 users found this section helpful
Suggest Edit