playMaker

Author Topic: Need help - Idle to walk FSM[SOLVED]  (Read 2093 times)

Mangledmind

  • Playmaker Newbie
  • *
  • Posts: 3
Need help - Idle to walk FSM[SOLVED]
« on: December 28, 2012, 03:57:11 PM »
Hello im trying to make an FSM for an Idle to Walk state. at the moment im using a get button down, which triggers when ever the input of Horizontal OR vertical is set, switching to the on state, and the opposite for a get button up.

the problem is that if a player is pressing W and D at the same time (to move diagonally) - if he were to the let the D button up, he would stop moving entirely and go back to the idle stage instead of then only moving straight (since he'd still be holding down the W button)

sorry if this has already been posted / address. but im new here and have yet to see anything about this.
« Last Edit: January 01, 2013, 08:15:10 AM by jeanfabre »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Need help - Idle to walk FSM
« Reply #1 on: December 28, 2012, 04:33:26 PM »
well, you can always use a float compare :



Granted, this does not work if you press A and D at the same time, but nevertheless, it may help. For A and D you need to work with booleans, at least that's how I do it.
Best,
Sven

Mangledmind

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Need help - Idle to walk FSM
« Reply #2 on: December 28, 2012, 09:47:11 PM »
Thanks that looks good, but can you please explain the "go" transition? idk how to send state 3 back to state 6 as youve shown in ur FSM diagram.

EDIT: nvm i got it working, had to setup Go as a global translation. thank you for your help it seems to perfectly =)
« Last Edit: December 28, 2012, 09:53:54 PM by Mangledmind »