Pointer.worldX Does Not Work in Update Loop

Please watch this short video to see the a visual of the problem. pointer issue - YouTube

I use this.pointer.worldX/worldY to determine which image the pointer should use, my code snippet is below. The issue is that when I refer to worldX and worldY from the update loop, it does not work, those properties are the same as pointer.x and pointer.y (their position on the screen, not the map) I logged the pointer and searched all throughout, could not find a property that refers to the pointer’s coordinates on the map.

What is strange is that the direction of the attack is always correct, while the direction of the arrow is wrong when I’m not in the top left corner of the map… but I use the exact same logic for both of these.

The only difference between the two is that the attack direction is called from the player’s constructor while the red arrow direction is determined in the update loop.

In short, pointer.worldX and pointer.worldY work correctly when called from the constructor, but when called from the update loop, they’re the same as pointer.x and pointer.y

      if (this.pointer.worldY <= this.player.y && Math.abs(this.player.x - this.pointer.worldX) <= 24){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_up.png), pointer')}
    else if (this.pointer.worldY > this.player.y && Math.abs(this.player.x - this.pointer.worldX) <= 24){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_down.png), pointer')}
    else if (this.pointer.worldX <= this.player.x && Math.abs(this.player.y - this.pointer.worldY) <= 24){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_left.png), pointer')}
    else if (this.pointer.worldX > this.player.x && Math.abs(this.player.y - this.pointer.worldY) <= 24){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_right.png), pointer')}
    else if (this.player.x <= this.pointer.worldX && this.player.y > this.pointer.worldY){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_up_right.png), pointer')}
    else if (this.player.x <= this.pointer.worldX && this.player.y <= this.pointer.worldY){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_down_right.png), pointer')}
    else if (this.player.x > this.pointer.worldX && this.player.y <= this.pointer.worldY){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_down_left.png), pointer')}
    else if (this.player.x > this.pointer.worldX && this.player.y > this.pointer.worldY){
      this.scene.input.setDefaultCursor('url(assets/red_arrow_up_left.png), pointer')}

How can I get pointer.worldX and pointer.worldY from update?

If I look at this example, it seems to work just fine. Maybe update your Phaser version?

Just downloaded 3.54.0, screen x and world x are still the same from my update, and different from the constructor

Put your code online somewhere. As you can tell from the example, the problem does not seem to be with Phaser.