Abruptly turning by sprite rotation!


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 ?


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


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.