Double Tap/Click Behaviour

vodkaman6661

  • Posts: 121
Hi

I was looking for a double click behaviour on the stencyl forge and on the stencyl forums but couldn't seem to find on. Any ideas how to go about it?

Ive tried if clicked set clicked number to 1 them if clicked number equals 1 and the actor is clicked again set the clicked number to 2 but this falls to work as once you click in the actor it goes straight to 2 and the number doesn't reset.

I'm sure theres a simple solution I just can't think of it at the minute.

Thanks for any help :) 

yoplalala

  • *
  • Posts: 1632
I haven't tried it but I would use one boolean ClickedOnce.

So When you click
If clickedonce = False
 clickedonce = true
  set Timer = 0
otherwise if clickedOnce = True
   Action
 

Always
Timer = Timer +1
If Timer > 1 second
    clickedOnce = false

vodkaman6661

  • Posts: 121
Thanks for the help.

I've just been trying the method that you gave me but I'm not sure that it works.


yoplalala

  • *
  • Posts: 1632
Heello, vodkamen , did iy finally work or not ? :)

For the timer.
I thought of the timer because you must wait too much between two clicks.
So better than always. It's maybe better to use
every 0.1 second
Timer = timer +1

Alwyas
If timer > 10  ( so after about 1 second)
    clickedOnce = false