playMaker

Author Topic: [SOLVED]How do I make a double tap to run with Playmaker?  (Read 3602 times)

G-Kaiser

  • Playmaker Newbie
  • *
  • Posts: 34
[SOLVED]How do I make a double tap to run with Playmaker?
« on: December 12, 2013, 11:11:54 PM »
Hello,

I would like to know how I would go about making a double tap to run with Playmaker? I already have the animation. I just need to be able see it once the right arrow is tapped twice on the keyboard or joystick.

Thank you in adavnce.
« Last Edit: December 13, 2014, 06:41:44 AM by G-Kaiser »

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: How do I make a double tap to run with Playmaker?
« Reply #1 on: December 13, 2013, 07:55:45 AM »
try this template. its a helper fsm which will enable/disable a bool depending on click/doubleclick. this bool can be used in your main FSM. You can adjust the wait times for double click sensitivity.

http://www.evernote.com/shard/s239/sh/da8f4d6e-d8ed-4cc0-9bda-dfa8525385bb/fc3ce6347b73fafddf6b027221a1e9d5

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: How do I make a double tap to run with Playmaker?
« Reply #2 on: December 13, 2013, 01:46:50 PM »
Another option is an FSM which uses the "wait" function to essentially do the same function as the helper FSM posted above:

State 1: On click/key press, move to a new state named state2
State 2: On click/key press, transition to state that activates run. Also add a "wait" action to this state, where after X amount of time, it sends an event which returns the FSM to state 1. The X time is the time between clicks, or "double click" speed. You would want this number to be pretty small, maybe try .25 as a starting point.

This way, if the player presses the run key once, but not again after a short time, the FSM won't activate the run state.