Changing animation when moving

Game Editor comments and discussion.

Changing animation when moving

Postby phyzix5761 » 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!
phyzix5761
 
Posts: 261
Joined: Sun Feb 27, 2011 4:28 am
Score: 18 Give a positive score

Re: Changing animation when moving

Postby skydereign » Sun Feb 27, 2011 8:35 am

That's called moonwalking. There are many fixes to moonwalking, but my favorite is by using a state variable. Here's an example of what I mean.
http://game-editor.com/forum/download/file.php?id=4965

If you want an explanation with it you can go here, or I can pm you the details.
http://game-editor.com/Moonwalking
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Changing animation when moving

Postby phyzix5761 » Thu Mar 03, 2011 8:01 pm

Thank you.
phyzix5761
 
Posts: 261
Joined: Sun Feb 27, 2011 4:28 am
Score: 18 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest