Hi,
I cannot for the life of me figure out what the name of the State Machine visual scripting component is. I’d like to disable the graph from C# during scene cleanup.
Really struggling with the Unity Documentation of late.
Hi,
I cannot for the life of me figure out what the name of the State Machine visual scripting component is. I’d like to disable the graph from C# during scene cleanup.
Really struggling with the Unity Documentation of late.
As a workaround you could nest your state machine graph inside a flow graph using the State Unit which can be manually started/stopped. Then you can use the regular custom events API for that.
https://docs.unity3d.com/Packages/com.unity.visualscripting@1.7/manual/vs-state-unit-nodes.html
Thanks for the response and the workaround! Does this mean there is not a way to find and disable a state graph from code?
No clue, the tool always was marketed to non-coders before acquisition. So stuff like that has never been documented and I’ve also never attempted to do that before. It might be possible, according to the current naming scheme it should be of type StateMachine.
According to our Scripting API reference, the class name for a State Machine asset should just be StateMachine: Class StateMachine | Visual Scripting | 1.7.8
Yes but far as I can tell that is not the “component” on the object. So you can’t GetComponent(). So I cannot for example GetComponent().enable = false;
I’m assigning a component to the object in the editor. Not seeing how to reference the assigned component.