Infinate Runner Attack Animation
salochin59
Member Posts: 25
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
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.
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.