0
Answered

How do you access user-defined class (functions or variables) within flow or state machines?

piewsook 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 3

Is there a node that can be used to access functions and variables from user-defined scripts that is attached to the same game object as a flow or state machine or a different game object? I tried GetComponent but could not find any reference for the script component.

I saw this in the question on coroutines but couldn't figure how to get the node (like the "CoroutineTest" node) into my Bolt graph:


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

You have to regenerate scripts in Tools > Bolt > Update Unit Options. That is all you need to do if it is a monobehaviour you just made. If it is non mono behaviour, the you need to goto Tools > Bolt > Unit Options Wizard and to the last tab and add the classes in types. From there right clicking in the fuzzy finder will generate your code in your namespace under Codebase.

*Edit: If you have a dll assembly, then you need to add that in assemblies.

+1

It works! Thank you for your help! :)