# setCollideWorldBounds() Not Working

**URL:** <https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469>\
**Category:** Phaser 3\
**Created:** [May 3, 2021, 11:01pm UTC](https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469 "2021-05-03T23:01:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![t\_rev44](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/t_rev44/32/4157_2.png) [@t\_rev44](https://phaser.discourse.group/u/t_rev44)\
**Post date:** [May 3, 2021, 11:01pm UTC](https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469/1 "2021-05-03T23:01:48Z")

</div>

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

---

<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:** [May 4, 2021, 2:23am UTC](https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469/2 "2021-05-04T02:23:11Z")

</div>

> [@t\_rev44](#):
>
> Even if I manually plug in the world width and height, it still sets it to the camera’s dimensions.

How are you doing this?

---

<div class="post-metadata">

**Author:** ![t\_rev44](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/t_rev44/32/4157_2.png) [@t\_rev44](https://phaser.discourse.group/u/t_rev44)\
**Post date:** [May 4, 2021, 3:42am UTC](https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469/3 "2021-05-04T03:42:03Z")

</div>

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

---

<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:** [May 4, 2021, 3:11pm UTC](https://phaser.discourse.group/t/setcollideworldbounds-not-working/9469/4 "2021-05-04T15:11:23Z")

</div>

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.
