Constraining Rotation to the Mouse Position
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?
Anybody know how I could achieve this?
Best Answer
-
AcceleratedGames Posts: 201
Do the following:
Constrain self.Rotation to vectortToAngle(self.Position.X - game.Mouse.Position.X, self.Position.Y - game.Mouse.Position.Y)
Answers