Walking characters needs to face forward

FangFang Member Posts: 33
edited November -1 in Working with GS (Mac)
The title basically explains my situation.

I've got a top-view scene, so you look onto the character's head, but you can see his feet and everything so you know which way he is facing.
I was wondering how to make him rotate according to the direction he moved in. I found this in an old thread:
constrain self.rotation to vectorToAngle(self.linear.motion.X,self.linear.motion.Y)

It works fine, really. I just have two issues with it.

First and foremost, when I stop moving, he defaults back to his normal orientation. Is there any way for me to "sticky" his rotation until he starts moving again?
Oh, whilst typing that I thought up the solution. Put the contrainment of the self.rotation atribute inside a rule, and make it so that it only does its job when a movement key/trigger is pressed/activated.

Second, it's a little... hacky, if that makes any sense. When I turn to the left, he imidiatly shifts to the orientation he's supposed to have when moving left. Can I make it so that he turns himself around before and/or while moving in that direction? Like, make it take one second of rotating before he reaches the orientation he's suppoed to stick with?
Yes, I'm using the move behavoirs. No, accelerate is not an option. It gives for a smooth rotation, okay, but it's not suited to my needs.

Comments

Sign In or Register to comment.