0 Favourites

[Resolved] Stopping input during an attack

  • Currently working on a game where when on the ground the player stops moving and does the attack animation, then can either attack again or move afterwards.

    DELETED

    Currently while moving, it breaks the animation loop for attacking and thus prevents it from going through as I have it triggered on animation statuses.

    Idealy there would be a fraction of a second time between when the player gets control to attack VS the player gets control to move, however I'd probably go for a simpler solution if that is complicated.

  • I can't look at the capx right now, but the basic premis is to simply do this.

    Add a variable that becomes active every time the player presses the attack button

    on keyboard pressed "A"

    ->set "attacking" to 1

    ->play animation "attack"

    then in the section that has all of your movement stuff.

    add a condition that only allows the player to move if "attacking" is set to 0

    on keyboard pressed "right arrow"

    AND

    (system) attacking = 0

    -> move player right.

    this way it will only work while not attacking.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Thanks for the reply.

    After looking into it, set it a number value and still didn't stop, but then I added a Wait 0.1 to the beginning of the attack function and it made it work properly.

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