Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Jake on February 19, 2013, 02:54:53 AM

Title: Problem with GetAxis translating into multiple states
Post by: Jake on February 19, 2013, 02:54:53 AM
Hi,

I've got a simple setup (at least I thought so):

1.) State "WaitForInput" containing GetAxis and FloatCompare, the latter creating events "MoveLeft" and "MoveRight"
2.) State "MoveLeft" containing a Translate and then Finish => returning to "WaitForInput"
3.) "MoveRight" just like 2.)

The problem is that after first Input the FSM stays in "MoveLeft" instead of returning to "WaitForInput".
If I do the Translate in "WaitForInput" everything works, but as MoveLeft and MoveRight will do several actions I wanted to separate them into single states. I guess that everyFrame might be a problem in this scenario, but I'm not quite sure.

Any ideas how to solve this?

Jake
Title: Re: Problem with GetAxis translating into multiple states
Post by: Alex Chouls on February 19, 2013, 10:47:17 AM
Actions with Every Frame checked do not finish.

With your setup you might try a Next Frame Event to send FINISHED.
Title: Re: Problem with GetAxis translating into multiple states
Post by: Jake on February 19, 2013, 01:58:34 PM
Hi Alex,

thanks for your help, this did the trick, but I don't understand why?! I've added the Next Frame Event to my Move states. These states don't have actions with Every Frame in it, so shouldn't they process down to their FINISH and then return to my WaitForInput state without the "Next Frame Event" action? They actually don't, but shouldn't they?
Title: Re: Problem with GetAxis translating into multiple states
Post by: Alex Chouls on February 19, 2013, 02:28:19 PM
What actions do you have on your move states? Can you post a screenshot?

Either way I think you'd want to use a Next Frame Event to avoid an infinite loop... you don't want to loop in a single frame, you want to do it each frame. Does that make sense?