Stencyl 3.4.0 is now out. Get it now!

Walking Animation Issue- Please Help!!

RidesWithMason

  • Posts: 5
Hi, I'm trying to make my first game, and am entirely new to the whole process. Currently I'm having an issue getting my walking animation to function correctly. I've made the animations (walk right, walk left, idle.) I've assigned the "walk right" animation by using "switch animation to" but when I test the game my actor only displays the first frame of my "walk right" animation once I hold right. Instead of the four frame walking animation loop. Please help! Thank you <3

Luyren

  • *
  • Posts: 1341
Post the code you made or the behaviors you are using so we can help. By your description, it might be conflicting animations.
Working.

RidesWithMason

  • Posts: 5
Thank you for the help. Here's the code I'm using!

Luyren

  • *
  • Posts: 1341
Simplest fix would be to put the animation standing and set X to 0 at the bottom of the code, within an "otherwise" block. If that doesn't work, put that at the bottom of the code, and then at the end of the "press right" and "press left" wrappers place a "stop" block.
Working.

RidesWithMason

  • Posts: 5
I tried what I think you were explaining. But, I'm still having the same issue. My actor moves both right and left, but he holds the first frame of the walking animation as he moves. Thanks again for helping.

RidesWithMason

  • Posts: 5
Ahh, I figure it out by removing the first line of "standing" code, which I'm sure is what you were saying. Could you explain to me why this works? So, I can understand this moving forward!!  :)

Luyren

  • *
  • Posts: 1341
The  update event is executed every 0.01 seconds, and the code is executed from top to bottom. You were always switching back to your standing animation before checking for the right or left key presses to change to the walking animations. So you were switching to the standing animation, and then to the walking animation every 0.01 seconds, resulting in the "stuck animation" effect you saw.
Working.

KaB00MxRHx

  • Posts: 7
Thank you Luyren for explaining that that's very helpful!