animation help

zombotszombots Member Posts: 186
edited November -1 in Working with GS (Mac)
i have an actor that follows the main player and i want it to animate when it walks left or right.
like if the actor is moveing right play the right animation and if its moving left play the left animation.
does anybody have any ideas on how to do this?


  • harrioharrio Member Posts: 234
    what's cookin,

    i think you could try basing the actor animations on the keypress of the player.

    something like: if player pressing left key then actor runs the left animation.
  • zombotszombots Member Posts: 186
    sorry i didnt explain that the best im using Chasing the actor from
    and i got a few actors that move towards the position of the player.
    i need it to still animate if the player stop but the other actor is still moving towards him if that makes sense?
  • KamazarKamazar Member Posts: 287
    Gah, I posted after you added details. ... is there a way to track an actor's direction? The only way I know is to find the difference between the actor's position at one point in time and then again at another, and whether or not the answer's negative or positive would define what direction it's going, but yeah... kinda complicated.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You could check if the self.Motion.LinearVelocity.X is less than 0, then it is moving left and do that animation, etc...
  • zombotszombots Member Posts: 186
    thanks heaps codemonkey
Sign In or Register to comment.