setCollideWorldBounds() Not Working

this.player.setCollideWorldBounds() isn’t working for me. It’s setting it to the dimensions of the camera instead of the dimensions of the map. Even if I manually plug in the world width and height, it still sets it to the camera’s dimensions.

If that doesn’t make sense, my camera is 1066x600, the world map is 1280x640. Using that method, it won’t let the player go to the right of 1066 or lower than 600

How are you doing this?

    this.player.setCollideWorldBounds(true, 1280, 600)

Remove the numbers, those arguments are bounceX and bounceY.

this.player.setCollideWorldBounds(true)

You probably just need to set the bounds like

this.physics.world.setBounds(0, 0, 1280, 600);

Adjust (x, y) as needed.