Strange GameObject location after zoom

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 someone had the same problem but got no answers.

I have created an example at codepen.
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…

:wave:

Use

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

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