Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Andreas Tabak on March 22, 2019, 11:54:44 AM

Title: Hold down Key to make character do special move [SOLVED]
Post by: Andreas Tabak 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
Title: Re: Hold down Key to make character do special move
Post by: djaydino 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
Title: Re: Hold down Key to make character do special move
Post by: Andreas Tabak 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
Title: Re: Hold down Key to make character do special move
Post by: Andreas Tabak on March 23, 2019, 04:57:57 AM
Hi djaydino, you solution worked perfectly. Thanks so much!
Title: Re: Hold down Key to make character do special move
Post by: djaydino on March 23, 2019, 11:01:47 AM
Hi.
No problem, happy to help!