Abruptly turning by sprite rotation!


#1

This example

Sprite rotation in left mouse button pressed i did. But when I click on the other side of the sprite, it flips over. Turns too fast and abruptly. How to make sure that the sprite rotates smoothly and does not change sharply position no matter in which part of the screen was a mouse click ?


#2

As the example works fine a bit of code will be appreciated :slight_smile:


#3

The example you provided does not work with clicks but with movements. I guess that’s the main difference. If you wanna rotate a sprite from an angle to another smoothly, I’d suggest using a tween for that preserve some logic within the update method, led in by a boolean flag for example.