Custom Script???

CGBull 4 years ago updated 4 years ago 7

  I write a custom c sharp script . in bolt i can get custom function , but play is error.


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

Means you are missing an object. Is the flow on the same object as the script? If you intend for it to be used globally from anywhere on any object without an instance of the script, you need to change from "public void" to "public static void".

I just write the script, but didn't hang onto the object of the same Flow Machine. Does it mean that I have to add static modifiers to run? .

i change the Modifier , public void to public static void . but game object.transform.translate can use.......

No, just make sure both the Flow machine and your script are on the same game object. As Lazlo stated, that's why the error occurs.

You only needed a static modifier if you don't need information from a specific instance ever and plan to reuse your code in multiple places. Then you would need a "Transform yourVariableName" parameter added in the parenthesis. Referencing that instead of gameObject.transform.

Make sense?

Ok , i got it . thanks


It looks like the game object with the flow graph does not have a Test_name_One component.