How to change the way your actor is facing based on the direction it's moving in

School on Interactive DesginSchool on Interactive Desgin Member Posts: 68
edited November -1 in Working with GS (Mac)
Assistance on this is GREATLY APPRECIATED!

So here is what I currently have an actor doing...
When you touch a location on the screen the actor will then move to that locations. Simple right!

Here is what I need help with...
I can't just have a actor move to a location, I also need to have it face the direction it is moving in.

So for example, you have a little cat on your screen, you touch a location and the cat moves there, but if you touch a location behind the cat he will need to turn around so he is not walking backwards. Get it? I only need the cat to face either left or right, not up or down.

THANK YOU FOR YOUR HELP!!!!

Comments

  • tshirtbooth <== The Master of all GS help!!
    Thanks man, I will check it out and let you know if it solves my problem. Other wise I am coming back on here and harassing you. :)
  • tshirtbooth <== The Master of all GS help!!
    Thanks man, I will check it out and let you know if it solves my problem. Other wise I am coming back on here and harassing you. :)
  • Hey Mr.T
    For some reason Safari keeps crashing on me when I try to get to the link you posted. Any way you can just email the project.

    contact(at)secretgamelab(dot)com
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Its just an image change based on the direction your moving. GS cannot flip an image for you you must have a right image and a left image you switch between.
  • tenrdrmer,

    Yes I understand that I need a "walk left" animation
    and a "walk right" animation. :) Sorry if I did not explain myself well.

    But what I need to learn from whom ever knows it is how to switch between the two when my actor is moving to the left or moving to the right.
  • MotherHooseMotherHoose Member Posts: 2,456
    Rule when touched is pressed
    -Rule when self.Position.X > touch1.Position.X
    -- do the Left Animation
    Otherwise:
    -- do the Right Animation

    MH
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You can also do when attribute self motion linear velocity x is > 0 do right animation, and another rule when attribute self motion linear velocity x is < 0 do left animation

    cheers
Sign In or Register to comment.