Search Unity

Bolt - Visual State Machine

Discussion in 'Visual Scripting' started by antoniomonteiro, Oct 11, 2020.

  1. antoniomonteiro

    antoniomonteiro

    Joined:
    Nov 25, 2017
    Posts:
    4
    I dont want to use Visual Scripting, but i really like the ideia of a Visual State Machine.

    Can i use only Bolt State Machine and the logic from my scripts?

    Anyone have a example of that?

    Thank you.
     
  2. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Bolt state machine basics:


    Advanced example of C# script use in Bolt state machines:


    Long story short, you add your C# scripts in Tools/Bolt/Unit Options as new types, then regenerate units. This process exposes all public methods, variables and properties to Bolt and automatically generates nodes for them. They will come up in Bolt's fuzzy finder like any other node and they serve as a bridge between your C# scripts and Bolt graphs. You can then use your C# script nodes in Bolt's state machines.
     
    antoniomonteiro likes this.
  3. antoniomonteiro

    antoniomonteiro

    Joined:
    Nov 25, 2017
    Posts:
    4
    How to "trigger" the transition?
    like listening to a bool variable, idk isWalking and when isWalking is set to true need to make a transition to another state, but when change isWalking dont make the transition
     
  4. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Update with a Branch unit that checks isWalking condition. If true, it routes the flow to Trigger State Transition unit, if false - nothing happens.
     
    Last edited: Oct 13, 2020