# Strange GameObject location after zoom

**URL:** <https://phaser.discourse.group/t/strange-gameobject-location-after-zoom/11140>\
**Category:** Phaser 3\
**Created:** [January 30, 2022, 4:39pm UTC](https://phaser.discourse.group/t/strange-gameobject-location-after-zoom/11140 "2022-01-30T16:39:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloPin](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@FloPin](https://phaser.discourse.group/u/FloPin)\
**Post date:** [January 30, 2022, 4:39pm UTC](https://phaser.discourse.group/t/strange-gameobject-location-after-zoom/11140/1 "2022-01-30T16:39:15Z")

</div>

Hello,

I am placing a rectangle always at the pointer location. Works great.  
But when I set a camera zoom, this doesn’t work, the rectangle position is not where the cursor is.  
[Here](https://www.reddit.com/r/phaser/comments/i7we86/help_camera_zoom_messes_with_pointerx_and_pointery/) someone had the same problem but got no answers.

[I have created an example at codepen.](https://codepen.io/FloPinguin/pen/ZEabmOE)  
Move your cursor and then do it again after pressing the button.  
I think there is an easy solution but I couldn’t find it…

---

<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:** [January 30, 2022, 4:40pm UTC](https://phaser.discourse.group/t/strange-gameobject-location-after-zoom/11140/2 "2022-01-30T16:40:45Z")

</div>

👋

Use

```
this.rect.setPosition(pointer.worldX, pointer.worldY);
```

---

<div class="post-metadata">

**Author:** ![FloPin](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@FloPin](https://phaser.discourse.group/u/FloPin)\
**Post date:** [January 30, 2022, 4:58pm UTC](https://phaser.discourse.group/t/strange-gameobject-location-after-zoom/11140/3 "2022-01-30T16:58:24Z")

</div>

wow. somehow I missed worldX and worldY. Thank you very much samme!
