Animation conundrum

0 favourites
  • 5 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Hey,

    So, I want to set a different animation when the player collides with a crate while holding jump.

    What I tried to do was:

    On collision, Keyboard "space" held set player vector Y=-600, set animation to "High jump"

    The bounce works perfectly.

    What ends up happening is that the "High jump" animation plays for about a frame before defaulting to the standard jump animation.

    How would I go about negating the jump animation?

    Thanks

  • How exaclty is the standard jump animation being handled? it sounds like it's overriding what you're trying to do.

    I'd also recommend using a once while true when holding a button like that, as it will loop through that event continuously and potentially keep resetting the animation.

  • Well, you should probably add if SPACE not held and/or if high jump animation not playing then play normal jump animation.

    It sounds like you are triggering high jump animation and then it goes back to normal jump because all conditions for that one are met.

  • Hey,

    So, I want to set a different animation when the player collides with a crate while holding jump.

    What I tried to do was:

    On collision, Keyboard "space" held set player vector Y=-600, set animation to "High jump"

    The bounce works perfectly.

    What ends up happening is that the "High jump" animation plays for about a frame before defaulting to the standard jump animation.

    How would I go about negating the jump animation?

    Thanks

    Another approach to try is to set a flag with a boolean (called something relevant like "High Jump") when the player collides with a crate whilst holding jump. Then you would test to see whether the boolean "High Jump" was set to true. Whenever it is set to true you would run the High Jump animation that you want to play. You could also easily add code to ensure the normal jump animation doesn't play whilst the boolean "High Jump" is set if needed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks I got it working

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