# Rotation breaks on zoom

**URL:** <https://phaser.discourse.group/t/rotation-breaks-on-zoom/12247>\
**Category:** Phaser 3\
**Created:** [August 31, 2022, 2:54pm UTC](https://phaser.discourse.group/t/rotation-breaks-on-zoom/12247 "2022-08-31T14:54:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lplofty](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/lplofty/32/6900_2.png) [@lplofty](https://phaser.discourse.group/u/lplofty)\
**Post date:** [August 31, 2022, 2:54pm UTC](https://phaser.discourse.group/t/rotation-breaks-on-zoom/12247/1 "2022-08-31T14:54:13Z")

</div>

Hi there, I’ve got a basic sprite rotate with mouse thing going on, but when I zoom in at all, the angles get all messed up.

Here’s the relevant code:

update() {  
this.currentPointer = {  
x: this.config.scene.input.activePointer.x + this.config.scene.cameras.main.worldView.x,  
y: this.config.scene.input.activePointer.y + this.config.scene.cameras.main.worldView.y,  
}  
this.setAngle(Phaser.Math.Angle.Between(this.body.position.x, this.body.position.y , this.currentPointer.x, this.currentPointer.y) \* (180/Math.PI))  
}

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [August 31, 2022, 2:57pm UTC](https://phaser.discourse.group/t/rotation-breaks-on-zoom/12247/2 "2022-08-31T14:57:09Z")

</div>

👋

```javascript
const { worldX, worldY } = this.config.scene.input.activePointer;

this.setRotation(
  Phaser.Math.Angle.Between(
    this.body.position.x,
    this.body.position.y,
    worldX,
    worldY
  )
);

```
