determining the direction an actor is facing

Im making a zelda type game where my player can move an all four directions (up,down,left,right) how can i determine witch way the actor is facing to trigger the right animation? for example if my actor is facing up i want him to spawn the animation showing his back and if he moves left and lets go of the left arrow than i want him to spawn the standing left animation is there anything out there that can help me! i would gladly appreciate it thanks!!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Make an angle game attribute called game.direction. When the player presses a button to move in a certain direction, change the value of that attribute to match. For example, if the player presses a button to move up, change game.direction to 90 (90 degrees of a circle). Then base any animation off of the possible values of game.direction.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214

    Thank you! @tatiang‌ i will try that now!

Sign In or Register to comment.