playMaker

Author Topic: Wait for an animation in OnEnter/OnExit  (Read 1967 times)

devis.rossini

  • Playmaker Newbie
  • *
  • Posts: 18
Wait for an animation in OnEnter/OnExit
« on: June 08, 2015, 05:52:31 PM »
Hi,

I'm trying to use PlayMaker in order to create a FSM for my game's menu, that is a little complex. I have many menu pages, and each one can have an enter animation and an exit animation.
For each state I have to specify what pages must be opened. When I change state, from A to B, I should:

1. Wait in A::OnExit until menu page opened in A completes its closing animation.
2. Wait in B::OnEnter until menu page to open in B has completed its opening animation.

Since I can't wait for a coroutine in OnEnter/OnExit in a FsmAction, there's a way to handle this kind of situation?

Thanks a lot,

Devis

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Wait for an animation in OnEnter/OnExit
« Reply #1 on: June 08, 2015, 06:59:32 PM »
You could use an animation event in the end of the animation to do what you want-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

devis.rossini

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Wait for an animation in OnEnter/OnExit
« Reply #2 on: June 09, 2015, 02:06:27 AM »
Ok, an animation event can solve the problem but I have to create a pair of states for each menu page I want to open/close. If I have a state A, with a menu page and some logic attached, I have to setup:

FadeInA -> A -> FadeOutA -> ...

Doing this for every menu page is a lot of work, and the FSM becomes complex and full of redundant states. Are there alternative solutions?

Thanks a lot for your help!
« Last Edit: June 09, 2015, 02:13:57 AM by devis.rossini »