playMaker

Author Topic: Problem with GetAxis translating into multiple states  (Read 2117 times)

Jake

  • Junior Playmaker
  • **
  • Posts: 61
    • Fluffy Underware
Problem with GetAxis translating into multiple states
« 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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Problem with GetAxis translating into multiple states
« Reply #1 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.

Jake

  • Junior Playmaker
  • **
  • Posts: 61
    • Fluffy Underware
Re: Problem with GetAxis translating into multiple states
« Reply #2 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?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Problem with GetAxis translating into multiple states
« Reply #3 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?