How do I create animations "attack" and "crouchattack"

0 favourites
  • 10 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I asked this before and received an answer, but I tried and couldn't get it to work on my end.

    What I am trying to accomplish is using the same button to attack for both the "Attack" animation and the "CrouchAttack" animation.

    1) "Attack" should be the animation to access when pressing the attack button while standing and jumping.

    2) "CrouchAttack" should be the animation played when pressing the attack button while in the "Crouch" animation.

    The controls are:

    WASD to move

    "," to attack

    Here is the CAPX.

    https://www.dropbox.com/s/ct6o250kfjo5r ... ckup1?dl=0

    Thanks for any help that you can offer me even if it doesn't solve the issue it may lead me on the path to solving it myself.

  • What determines which animation it uses?

  • What determines which animation it uses?

    Well, if you are hold down the "S" key to crouch then you'll be in the "Crouch" animation. While being in the "Crouch" animation anytime you press the attack key you should "CrouchAttack" rather than "Attack".

    Is that what you are asking me?

  • Why dont you add a condition in attack, that plays the crouchattack animation only if the crouch is true, that should do it, instead of calling the regular attack animation. Right click on the event that calls for attack, and add the condition to check that the sprite is in the crouch animation, or whatever u have it named

  • Why dont you add a condition in attack, that plays the crouchattack animation only if the crouch is true, that should do it, instead of calling the regular attack animation. Right click on the event that calls for attack, and add the condition to check that the sprite is in the crouch animation, or whatever u have it named

    I'm looking for that condition and cannot find it. Can you be a little more specific with the directions?

    Sorry, kinda of a noob.

  • its easy, lets say you have it like this:

    EVENT // ACTION

    on click / [,] // character/ start attack animation

    what you need to do is create another event, similar to the regular shooting, or standing shooting, but this time, add an extra condition, like this:

    EVENT // ACTION

    on click / [,] // character/ start crouchAttack animation

    character / is animation"crouch" playing

    you add it by right clicking in the event section, and select add another condition, on the same( click[,]) event

  • I'm having a hard time understanding.

    I tried multiple times last night, but couldn't quite get a what I wanted.

    Is there anyway you could show me though the CAPX?

    https://www.dropbox.com/s/ct6o250kfjo5r ... ckup1?dl=0

    I don't mean to be a complete fool and having someone hold my hand through this entire thing, but I really just don't get this part.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would love to help brother, just give me a bit, and I'll help you as much as i can

  • You could put an instance variable on the sprite playing the animation called CrouchDetection

    And set it so every tick you are crouching set CrouchDetection to 1

    Then add and Else event and the action to set it to 0 so when your not crouching it will be 0

    And finally add a condition to your event that allows you to attack, and make it so the normal attack animation only plays when CrouchDetection equals 0, or make it so that the crouch attack animation only plays when CrouchDetection equals 1.

  • I put a bad CAPX earlier.

    Here is an update:

    https://www.dropbox.com/s/yq0wkhl3hvq3m ... .capx?dl=0

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