Issue with key held...annoyingly disturbing...

0 favourites
  • 6 posts
From the Asset Store
A collection of music for creating a disturbing and gloomy atmosphere, totaling over 50 minutes in length.
  • Video and pics below.

    This lil guy is meant to stop the shooting animation after the projectile has been launched. Unfortunately if you move while holding L (the trigger key) he stays in the shoot animation. It looks ridiculous of course. I know I can fix this if I say that the character must be stopped to do the shooting action but I want to be able to move and shoot at the same time. I tried changing L key is down with L key is pressed but the animation does not respond to it. I have tried moving a bunch of things around but I cannot get it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Youtube video:

    youtu.be/Xd0NW8fwLSI

  • Any help?

  • Since the shooting code (event 19) comes after the Movement Code (event 4), as long as the L key is down, the animation will get changed right back to the SHOOT animation on every tick.

    one thing you can do is move the Set Animation action in event 19 to event 23. that way the shoot animation will only show when a shot is actually fired.

    however, if the player is also moving, then the very next tick the animation will get changed back to a movement animation. So it will be almost impossible to see.

    you will need some kind of system to stop changing the animation for a short period of time...

    you already have the firerate/can_shoot variables, so I would add a subevent under each movement event (and the idle event if you are setting the animation there as well), have the subevent check if can_shoot=0, then set the direction / animation / mirrored / speed.

    (so just leave the Simulate Platform pressing actions where they are, move the rest of the actions to be under the new subevents)

  • just change "L is down" to "on L pressed" as you have the 2nd condition .... the L is down triggers the animation and the shooting mode... it's basically a continuous loop at the moment if "L is down".

    the 2nd subevent in the "L is down" is triggering once yes, but having it nested under "L is down" basically cancels the "trigger once" status.

    Move condition "on L was pressed" line 20 to 19 replacing the "L is down"

  • I appreciate the advice! Thank you very much!

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