Rotation flip based on sprite position.
Hi Guys,
I have created a sprite that looks at your mouse position, and have made a long level for the sprite to walk left and right in.
When I am on the left side of the level everything works as it should, but when I'm on the right the direction of the look gets flipped.
i.e. cursor is above and left of sprite, but sprite is looking top right.
Is a sprites rotation relative to it's position in the scene or something?
Crazy stuff,
Guardian
I have created a sprite that looks at your mouse position, and have made a long level for the sprite to walk left and right in.
When I am on the left side of the level everything works as it should, but when I'm on the right the direction of the look gets flipped.
i.e. cursor is above and left of sprite, but sprite is looking top right.
Is a sprites rotation relative to it's position in the scene or something?
Crazy stuff,
Guardian
Comments
I put update loop in by adding a timer that is set to every 0.2 seconds.
I then placed within it a 'change Attribute' and set self.rotation to equal vectorToAngle( self.position.X - game.Mouse.Position.X , self.position.Y - game.Mouse.Position.Y ).
I put the actor of the left side of the screen and it follows the full range of rotation. I put it on the right side of the screen and limits it to within 170 to 200.
This is really confusing me..
-Guardian