How to override one animation with another when actor jumps

lowskilowski Member Posts: 25
edited November -1 in Working with GS (Mac)
Hi. I am having issues with my jump animation. When right and left buttons are pushed the actor goes right and left. Great. But when the actor jumps the run animation continues. Stinky. I decided to have a jump animation or a change image attribute when my actor jumps. I guess my question is how to I override my run animation when my actor jumps? I've tried it so that the run animation will only go when on the ground but when the actor jumps he can only jump straight up because my animations are tied to my velocities.

Thanks

Comments

  • lowskilowski Member Posts: 25
    I still can't get it to work. I've searched the forums but haven't come up with anything.

    I somehow need to have my run animation when pushing a directional button but then when jump is pushed start another animation (with the directional button still down) until returning back to the ground.
  • SingleSparqSingleSparq Member Posts: 1,339
    Create a rule for jump. If jump is pressed do this animation, otherwise do run animation.
  • lowskilowski Member Posts: 25
    I've tried this. The problem is that I want to keep control of the character while he is in the air (limited movement in the air before he hits back down) therefore the directional buttons must be pushed while he is jumping. Since the run animation is under my movement commands adding a "if jump is pressed do this animation" does not work. It tries to do the animation but then is overcome by desires to start the run animation again.
  • lowskilowski Member Posts: 25
    I just realized that I misread what you wrote but I also have tried that and it doesn't work. For some reason the commands in the otherwise area are still overriding the jump animation
  • SingleSparqSingleSparq Member Posts: 1,339
    If you use a boolean switch say - If I hit jump, change Jump boolean to yes. If boolean = yes then trigger Jump animation. If I touch the ground, boolean to no, No = run animation. May have to through a timer in there .
  • HachikoHachiko Member Posts: 330
    If self.motionY is 0, and left key or right key are pressed, run those animation.
    if self motionY is greater than 0, and left key or right key are pressed, run those other one.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    There is a jumping demo on my profile.
    It may or may not help.
    I don't remember off hand the rules.
    I do know it only animates on the ground.
Sign In or Register to comment.