playMaker

Author Topic: How to update vars in Hierarchical State Machines via Run FSM?  (Read 1488 times)

sparklingwiz

  • Playmaker Newbie
  • *
  • Posts: 1
Hi, I am having difficulty implementing a hierarchical FSM via Run FSM like such:

Parent FSM
1. Idle, Running states

Child FSM (via Run FSM)
1. Idle (Parent)
2. Normal Idle, Fighting Idle states

Current flow is as such:
1. Parent state get property from script (i.e. something like a Input.GetButton)
2. Parent state uses Run FSM action
3. Parent state send property down Run FSM via Inputs (Flagging inspector at child FSM variables)

This should in theory give me the ability to:
1. Switch between different animations at different idle states
2. Transition to running state from both idle states


Unfortunately, it seems like the Run FSM only sends input ONCE during activation, and I cannot change the child state as my parent state is running. Are there any ways to implement something like this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: How to update vars in Hierarchical State Machines via Run FSM?
« Reply #1 on: June 14, 2020, 07:26:04 AM »
Hi.
Yes variables will be only send once.

But you can use Get/Set Fsm actions in the Template (the fsm in the 'Run Fsm')
You will need to target the object that has the variable (owner does not work)

I usually expose the Game Object / FSM Name / Variable Name if i want to reuse the template for other objects as well.

There are several other fsm actions on the Ecosystem
Like for example 'Fsm Bool Test'