# Sometimes sprite sticks to another sprite instead of bouncing off when they collide

**URL:** <https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342>\
**Category:** Phaser 3\
**Created:** [September 3, 2020, 12:40pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342 "2020-09-03T12:40:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabrieldavison](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gabrieldavison](https://phaser.discourse.group/u/gabrieldavison)\
**Post date:** [September 3, 2020, 12:40pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/1 "2020-09-03T12:40:46Z")

</div>

I am having a problem with a game I have been working on. It’s a game of pong with two computer players where the speed can be controlled by clicking on the game scene. The bug i am encountering is that at higher speeds the ball sprite will sometimes stick to the top and bottom boundaries or pass through the players paddles instead of bouncing off. Does anybody know what might be causing this? The collisions in the game are meant to trigger a synthesizer and when the ball sticks to a boundary it continuously triggers and sounds horrible. I have stuck the code on repl.it if anyone would like to have a look.

[https://repl.it/join/ctbnvaia-gabrieldavison1](https://repl.it/join/ctbnvaia-gabrieldavison1)

Thanks

---

<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:** [September 3, 2020, 2:39pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/2 "2020-09-03T14:39:29Z")

</div>

Can you make a vid?

---

<div class="post-metadata">

**Author:** ![gabrieldavison](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gabrieldavison](https://phaser.discourse.group/u/gabrieldavison)\
**Post date:** [September 3, 2020, 2:48pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/3 "2020-09-03T14:48:08Z")

</div>

[simplescreenrecorder-2020-09-03\_15.43.03.mkv](https://phaser.discourse.group/uploads/short-url/d7HxpnHmDVT098eFxBmJfUx5qCq.mkv) (243.3 KB)

Here’s a recording of it happening. The behavior I’m talking about is where it sticks to the top boundary and slides along it instead of bouncing off it.

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [September 3, 2020, 3:24pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/4 "2020-09-03T15:24:54Z")

</div>

> [@gabrieldavison](#):
>
> or pass through the players paddles instead of bouncing off

Hi,  
I had a similar problem when my character speed is too high and pass trough the floor, resolved with:

```javascript
create() {
  // set the fps to 120 for good collisions at high speed
  this.physics.world.setFPS(120);
}

```

---

<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:** [September 3, 2020, 3:31pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/5 "2020-09-03T15:31:57Z")

</div>

Yes, I would try increasing physics FPS.

The bounds problem is odd. Are you using the latest Phaser?

---

<div class="post-metadata">

**Author:** ![gabrieldavison](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gabrieldavison](https://phaser.discourse.group/u/gabrieldavison)\
**Post date:** [September 3, 2020, 4:19pm UTC](https://phaser.discourse.group/t/sometimes-sprite-sticks-to-another-sprite-instead-of-bouncing-off-when-they-collide/7342/6 "2020-09-03T16:19:19Z")

</div>

So increasing the FPS seems to have solved the problem. Thanks for the help!
