Infinate Runner Attack Animation

I currently have an infinite runner going with the continuous running animation looking just fine. I want my character to attack while running. I have a "Rule" set up "when key press [Space] is down, do (my attack animation)". My problem is when I attack it does not animate properly. My animation cuts in for a split second but then goes back to my running animation. How do properly pause my running animation for the attack and then restore running again?

Comments

  • BonepileGamesBonepileGames Member Posts: 194
    You can try by following these rules:

    Make REAL attribute into game with name "PlayAttack" change it to 0.

    Into your player(prototype) put this:

    Rule
    When key press SPACE is down
    Change attribute PLAYATTACK to 1
    Otherwise
    Change attribute PLAYATTACK to 0

    Rule
    If Playattack is 0
    Animate (running)
    Otherwise
    Animate (attacking)

    OR

    Rule
    When key press SPACE is down
    Change attribute PLAYATTACK to 1
    Otherwise
    Change attribute PLAYATTACK to 0

    Rule
    If Playattack is 0
    Animate (running)

    Rule
    If Playattack is 1
    Animate (attacking)

    Hope this helps, even though I didnt try it myself.


  • DeadlySeriousMediaDeadlySeriousMedia ArizonaMember Posts: 838
    If you want to get you attack animation to finish you need to figure out exactly how long it needs to run. So if its 8 frames of animation at 24fps then it needs 0.33 seconds. (8/24=0.33)

    Then you do the above but slightly different.

    Make REAL attribute into game with name "PlayAttack" change it to 0.

    Into your player(prototype) put this:

    Rule:
    When key press SPACE is down and PLAYATTACK = 0
    -Change attribute PLAYATTACK to 1

    Rule:
    If Playattack is 1
    -Animate (attacking)
    -After 0.33 seconds (run to completion)
    --Change attribute PLAYATTACK to 0

    This tells GS that, even after you release the space bar, you still want the animation to run for the full 0.33 seconds (8 frames of animation).

    I hope that makes sense.
  • salochin59salochin59 Member Posts: 25
    Thank you both. Sorry for the delayed response. Your suggestions seem to make sense. I will give it shot and let you know.
Sign In or Register to comment.