How do I get an animation to override another animation when a button is begin pressed

0 favourites
  • 4 posts
From the Asset Store
Ready-to-use buttons for your creations, two of each style, pressed and unpressed.
  • so the problem im having is that when you fire your gun a shooting animation is supposed to play but when moving (the moment keys play a walking animation) the firing animation doesn't work. for the firing animation i have set up a system that is suppose to override the animation but it only play the first frame then stops. the movement system im using is the custom one and here is a picture of my system that overrides my animation

  • The events for the walking animation are key here but I don't see them. In general though you need a condition on the walking event 'is not firing' or something similar. Also can you add the trigger once to the top level that's the standard, and also 'on animation finished' is a trigger event which only ever triggers once so no need to add a trigger once after this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here is the pictures of my walking code, and i dont know what the is not firing command or anything similar to that

  • Because the walk animation and the fire animation are true at the same time then both animations are trying to play. So you must block out one of them with a condition.

    So on the walk events you must add a condition like 'is not firing'. In the case of your game this could be one of the variables since you use them for firing. You could possibly also use 'rifle shoot animation is not playing' as a condition, it depends on the logic you set up.

    The key is to not allow the events to be true at the same time. If you are firing then the walking animation should not play, hence the walking animation event should be 'play walking animation when pressing WASD if you are not currently firing'.

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