Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: cloudjsh7 on April 04, 2018, 08:03:21 PM
-
Making a 2D Platformer. Pretty new to Unity/Playmaker. I've figured out how to get my character to attack. However, I haven't been able to figure out how to make my character attack twice if I click the "Attack" button twice within a certain amount of time (maybe like one second or so).
Can anyone point me in the right direction? ;D
-
You are looking for what I like to call 'a challenge condition'. (I have no idea of what its actually called).
As you may know, on one state, you can have two actions. Maybe right mouse click action and left mouse click action. That state is waiting for either mouse click.
Now, replace one mouse click with a wait action. So now you have a right mouse click and a wait. Whichever happens first, will decide what the next event/state will be.
So set your wait action to be around 0.1. or however long you want.
-
Hi,
yes, as Eric said.
else you can use a framework for these, like Input.Touches or EasyTouch, they got all of this covered for you, and they work with PlayMaker.
Bye,
Jean
-
EasyTouch seems to be deprecated.
Is 'Input.Touches' only for touch controls? I'm making a PC/Mac game with keyboard/Xbox controller inputs.
Also, is there way to maybe use some sort of "Time" function to make this happen?
Such as:
- Player clicks Attack Button (Get Key Down)
- Animation for the first attack fires (Animator Trigger or however I decide)
- A timer starts (????)
- If Player clicks Attack Button again before timer finishes then:
- play second attack animation
(if not)
- go back to Idle animation or whatever
-
Hi, that is what the wait action does. It is a timer.
-
What action would you use to check if the click has happened before the timer is up, in your example?
-
Maybe this image will help
-
@tcmeric
This worked great! Simple and thorough. Thank you!