Some help with attacking while walking

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I've been having a few problems with some movements I've been trying to do. Currently if you duck and attack once the animation is over the character stands up instead of remaining ducking. I'm also having some problems with getting him to attack while he is walking. I'm pretty sure it has to do with some conflicting instance variables but I can't figure out where I went wrong.

    Here is my work file:

    mediafire.com

  • Can't grab the capx right now, but I would look at the logic you have for attacking, does it set any animation when it ends, or does it update a variable that triggers another animation like standing?

  • To fix conflicts with instance variable simply use some Inverted (NOT) statements basically. So if X is Alpha and NOT Bravo then do the event... stuff like that...

  • Thanks for the help BluePhase!

    Here is a screen shot of what I have currently:

    <img src="http://i.imgur.com/BaGAp0Y.png" border="0" />

    You can see my last attempt there using the walking variable when ctrl is pressed. Unfortunately it just plays the walk animation still though.

    I also tried some other variations where if an arrow button is pressed play "walk attack" but if it is not pressed just play the regular attack and some other variations on that (i.e if this animation is playing when ctrl is pressed then play the "walk attack" animation)

    I think it might have something to do with me using 'Ctrl Pressed' instead of "Ctrl Down" if I switch it it kind of works but causes some other problems as I only want the animation to run through once and it causes conflicts with the ducking animation.

    Edit: I also managed to fix my ducking issue using what you suggested.

  • So I've mucked about with it and did some reading and have come to the conclusion that it must have something to do with the walking animation constantly refreshing due to the button being held down. I've seen some people say that you can get around that by attaching the character to an invisible block which I haven't done and seems like it may be a lot of work at this point.

    Does anyone know if there is a way to do this without having to set up the character that way?

    Here is my current .capx if anyone wants to check out what I've got so far.

    mediafire.com

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Finally managed to get the attacking problem worked out as well using NOT statements, thanks again BluePhaze!

  • No problem! Glad it was of some use for you. Sorry I haven't been able to keep up on this thread, been a hectic week.

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