Documentation

Learn how to use FlowCanvas

The FlowScript Controller

The most important component of FlowCanvas, is the FlowScriptController component. As the name suggests, this component is responsible for controlling a flowscript and you have to add it on a game object that you wish to be controlled by a flowscript. Although this is not really mandatory, it’s the easiest and the most suggested way to get started quickly. Once you have added the FlowScriptController component on a game object, you will notice that another component named “Blackboard” is also added. This is the place you will be creating variables, but more on these variables will be explained later on.

FlowScriptControllerInspector

The FlowScriptController needs to be assigned a FlowScript or alternatively, you can click the “Create New” button to create and assign one now. An option will pop up, asking you if you want to create a Bound or an Asset graph.

  • A Bound graph, is one that is bound to the gameobject on which the FlowScriptController is attached to. As such, this allows you to have and assign scene object references within the various nodes of the flowscript directly.
  • An Asset graph, is one saved as a .asset file within your project. The benefit of doing this is that it can be used and assigned amongst any number of different FlowScriptControllers if you so require, but the downside is that because it is an asset, you can’t have scene object references within the nodes of the flowscript. The Blackboard can still have scene object references however!

Creating a Bound graph is the recommended type in most cases, but don’t worry about it too much because you are able to convert between the two at any time you wish.

FlowScriptControllerInspector2

Once you have created a flowscript through the button, the graph editor will show up immediately. The FlowScriptController inspector has a number of options that you can set however.

  • Blackboard: The Blackboard reference that is used (this is generally speaking set automatically)
  • First Activation: An option to define when the first graph activation will take place (OnEnable, OnStart, or Async). The default is Async which will load the graph in a separate thread and thus keep the main thread without any overhead. The only downside to that, is that the graph will be “ready” a few frames later (2-3). If that is problematic for your setup, consider using the OnEnable or the OnStart option.
  • On Enable: Defines what will happen when the component is enabled (Enable Behaviour, or Do Nothing).
  • On Disable: Defines what will happen when the component is disabled (Disable Behaviour, Pause Behaviour, or Do Nothing).
  • Update Mode: Defines when the graph will be updated (Normal, Late, Fixed Update, or Manual).
  • Pre Initialize Sub Graphs: If enabled, will pre-initialize all subgraphs as soon as the root graph is initialized (in GraphOwner Awake).
Yes No Suggest edit
43 of 43 users found this section helpful
Suggest Edit

© Paradox Notion 2015-2024. All rights reserved.