0 Favourites

How to make a *Holding Button Trigger*.

  • Hi there I am fairly new to construct 2 . This been said.

    I am trying to Nail the CCC And I am still at the first C - Control.

    I am making a Beat them up prototype. The movement, the attack are done, I put a combo achitechture as well.

    What I would like to do is a other Button trigger in the equation.

    exemple: Pressing X, Pressing X, Pressing X, holding X for 2 sec (onrelease) BOOM HIGH Punch something like that.

    the thing I try to do is the; Holding * for * sec

    I started with instance, if look at the picture above it obviously didnt work ._., I tryed other pattern without result.

    In my head its king of clean, on X down every second you add 1, if on release you have 3 or more ONRELEASE is True. I just dont know how to go for it.

    I tried to find as well a BusterGun mechanic(megaman) type in the tutorial without success. I found something on magicbar Ill try something from that.

    PS. sorry for the bad english its not my mother tongue .

    Thank in advance for the help much appreciated.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Time = 2.0 seconds is not what you are looking for.

    Create a new variable, called timePassed for example, while button X is down do

    System > add to> timePassed > dt (dt is a system expression that means delta time, it holds the time passed between 2 frames)

    then change the Time = 2.0 seconds to timePassed > 3 (if you want 3 seconds).

    don't forget to reset timePassed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)