Rotating to face direction

QwazzMeQwazzMe Member, PRO Posts: 39

Hey guys

This is my first time asking help at the forum - I'm really new at Gamesalad... let's see how sweet and helpful you all are :wink:

I'm making a small game where a shepherd leads the sheep into a pen. I bought a template, but the movements are controlled with keys and as the game is for iPad, it does not make any sense to use a keyboard, so I need to change to touch.

I need the shepherd facing down when I drag it down and up when I drag it up, in the same way as left and right, and I just can figure out how to do it! I've tried using real attributes, but it is not working. Can anyone help me PLEASE?!

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692

    Constrain self.rotation to vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

    Make sure your image faces to the right if not you might need to add an extra value at the end for e.g. vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )+90

    Darren.

  • QwazzMeQwazzMe Member, PRO Posts: 39

    I will try, THANKS!

  • QwazzMeQwazzMe Member, PRO Posts: 39

    IT WORKS!!!

    Awesome, DeepBlueApps :smiley:

Sign In or Register to comment.