playMaker

Author Topic: State change Exit event? What are the best practices?  (Read 1698 times)

WhiteWingedWoof

  • Playmaker Newbie
  • *
  • Posts: 2
State change Exit event? What are the best practices?
« on: August 31, 2024, 08:45:44 AM »
Is there a way to catch the state change Exit? additionally is there a way to do the same with Enter (i know i can just trigger event from state itself but is there a more coding friendly way to do so?)

And for exits i know i can just make in between state but then with many exit targets i would have x2 states in there to map every exit apropriately ;/

Generally im using PlayMaker to handle FSM-s and for visual beauty of its transition mapping, and all the rest is running on scripts.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: State change Exit event? What are the best practices?
« Reply #1 on: August 31, 2024, 02:52:33 PM »
Hi,

you have several actions for this:

FsmStateSwitch
FsmStateTest
GetFsmState

So you can have an fsm that watch another fsm and if you detect a change in state you can trigger an event.

Bye,

Jean

WhiteWingedWoof

  • Playmaker Newbie
  • *
  • Posts: 2
Re: State change Exit event? What are the best practices?
« Reply #2 on: September 03, 2024, 08:19:34 AM »
Hey :D
Thanks for reply!

I tried your suggestions but sadly they didnt do it for me, then i solved it by just looking if current event im going to send is matching the current state transition events.

Thanks for the help :D
All the best