playMaker

Author Topic: Hold down Key to make character do special move [SOLVED]  (Read 1083 times)

Andreas Tabak

  • Playmaker Newbie
  • *
  • Posts: 9
Hold down Key to make character do special move [SOLVED]
« on: March 22, 2019, 11:54:44 AM »
Hi everyone,

I tried to check if there was anything on the forum but all I could find was some post that referenced a custom action that was no longer downloadable.

So the idea is that the player can do a normal jump by pressing the 'W' key, but can do a super jump if the 'W' is pressed let's say, 3 seconds.

How could you do such a thing in Playmaker? I guess you would need to create some sort of loop which tests if the key is still pressed and after 3 seconds it sets a boolean that a super jump can be made. But seriously, I have no idea  :-[

Thanks in advance!
Andreas
« Last Edit: March 23, 2019, 01:07:45 PM by Alex Chouls »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Hold down Key to make character do special move
« Reply #1 on: March 22, 2019, 02:03:53 PM »
Hi.

Try this:

State 1 :
Use 'Get Key Down' and transition to state 2 (when key pressed)

State 2 :
Use 'Get Key Up' and transition to short jump.
use 'wait' ,set to 3 sec and transition to super jump.

this is a way, but it depends on you game play if this works for you.

as player would not jump until key released or wait is done.

you could do short jump in state 2 with a add force and wait for key release or 3 sec. and go back to state 1

Andreas Tabak

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Hold down Key to make character do special move
« Reply #2 on: March 23, 2019, 03:58:06 AM »
Hi,

thanks for the quick reply. Sounds like a good idea. I will try this out and see what happens.

Thanks

Andreas Tabak

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Hold down Key to make character do special move
« Reply #3 on: March 23, 2019, 04:57:57 AM »
Hi djaydino, you solution worked perfectly. Thanks so much!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Hold down Key to make character do special move
« Reply #4 on: March 23, 2019, 11:01:47 AM »
Hi.
No problem, happy to help!