Constraining Rotation to the Mouse Position

ShineHouseGamesShineHouseGames Member, PRO Posts: 100
edited July 2012 in Working with GS (Mac)
So i have a system that moves the Actor towards the mouse position, but I'm not really sure how to constrain the actor's rotation facing towards the mouse position.

Anybody know how I could achieve this?

Best Answer

  • AcceleratedGamesAcceleratedGames Posts: 201
    Accepted Answer
    Do the following:
    Constrain self.Rotation to vectortToAngle(self.Position.X - game.Mouse.Position.X, self.Position.Y - game.Mouse.Position.Y)

Answers

Sign In or Register to comment.