# "Sometimes" collisions not working, can walk through the wall

**URL:** <https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831>\
**Category:** Phaser 3\
**Created:** [March 26, 2019, 8:55am UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831 "2019-03-26T08:55:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![peteroravec](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@peteroravec](https://phaser.discourse.group/u/peteroravec)\
**Post date:** [March 26, 2019, 8:55am UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/1 "2019-03-26T08:55:45Z")

</div>

Hi,  
I have strange issue… I have a collision layer, everything working fine - my sprite can’t walk through, but sometimes I can “walk through” the collision layer event if it’s there… I’m sure collision map is correctly set and collision tile is there…

Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![Antriel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/antriel/32/15_2.png) [@Antriel](https://phaser.discourse.group/u/Antriel)\
**Post date:** [March 26, 2019, 9:07am UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/2 "2019-03-26T09:07:30Z")

</div>

Which physics engine? With Arcade you should be able to decrease timestep (increase simulation FPS). With matter, I’m not sure it’s implemented in Phaser (fixed timestep that is).

What you are experiencing is called tunneling and it happens when a body travels bigger distance than the obstacle’s size in single step. So decreasing step size fixes that.

---

<div class="post-metadata">

**Author:** ![peteroravec](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@peteroravec](https://phaser.discourse.group/u/peteroravec)\
**Post date:** [March 26, 2019, 9:09am UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/3 "2019-03-26T09:09:19Z")

</div>

I’m using just ARCADE physics, I just need simple collision for one sprite… just not to walk through the collision layer, nothing else

---

<div class="post-metadata">

**Author:** ![Antriel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/antriel/32/15_2.png) [@Antriel](https://phaser.discourse.group/u/Antriel)\
**Post date:** [March 26, 2019, 9:13am UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/4 "2019-03-26T09:13:47Z")

</div>

Try adding `this.physics.world.setFPS(120);` (or more) in `create` then. There’s also a config option `fps` in the Arcade config.  
That will change the fixed timestep arcade will use, which will also change the simulation slightly.

---

<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:** [March 26, 2019, 3:47pm UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/5 "2019-03-26T15:47:20Z")

</div>

You can also adjust `tileBias` (`TILE_BIAS`).

Verify the collision edges on the debug graphic.

---

<div class="post-metadata">

**Author:** ![peteroravec](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@peteroravec](https://phaser.discourse.group/u/peteroravec)\
**Post date:** [March 27, 2019, 8:58pm UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/6 "2019-03-27T20:58:47Z")

</div>

This helps, thanks!

---

<div class="post-metadata">

**Author:** ![peteroravec](https://avatars.discourse-cdn.com/v4/letter/p/51bf81/32.png) [@peteroravec](https://phaser.discourse.group/u/peteroravec)\
**Post date:** [March 27, 2019, 9:01pm UTC](https://phaser.discourse.group/t/sometimes-collisions-not-working-can-walk-through-the-wall/1831/7 "2019-03-27T21:01:07Z")

</div>

Also this help too… let there both 😉
