Changing animation when moving
Posted: Sun Feb 27, 2011 5:59 am
I have a quick question, if you guys could please help me out.
I have created an actor that response to w,a,s,d for movement. The keys also control the walking animation for the actor. When the key is up the actor is instructed to return to the non-moving animation and halt movement in that direction. But I have an animation problem. I will illustrate with an example.
I press S to walk down. The animation works fine. I press D to walk right but decide to leave S pressed as well. The character moves in both directions but if I stop pressing one of the keys the actor's animation returns to non-moving although he is still moving. Is there any way I can fix this?
Thank you!
I have created an actor that response to w,a,s,d for movement. The keys also control the walking animation for the actor. When the key is up the actor is instructed to return to the non-moving animation and halt movement in that direction. But I have an animation problem. I will illustrate with an example.
I press S to walk down. The animation works fine. I press D to walk right but decide to leave S pressed as well. The character moves in both directions but if I stop pressing one of the keys the actor's animation returns to non-moving although he is still moving. Is there any way I can fix this?
Thank you!