This is a simple example of how to rotate something on a 2d plane, through trigonometry. To show this, the player rotates through the y position of the mouse. I have also added arrow key controls, and direction controls, move around. This is not included in the rotation. But you can easily change that if you use it. ----------------------------------Controls---------------------------------- Up arrow: move player up Down arrow: move player down Left arrow: move player left Right arrow: move player right A key (from W-A-S-D): rotate player left D key (from W-A-S-D): rotate player right
Trigonometry functions found at https://academo.org/demos/rotation-about-point/