# Scene postupdate event and the scene update() method problem

**URL:** <https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545>\
**Category:** Phaser 3\
**Created:** [March 17, 2020, 2:00pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545 "2020-03-17T14:00:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmb272](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jmb272](https://phaser.discourse.group/u/jmb272)\
**Post date:** [March 17, 2020, 2:00pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545/1 "2020-03-17T14:00:15Z")

</div>

Hi all,

I’m recreating the classic game breakout and have stumbled across a problem.

When the ball falls out of the game (the y position is greater than the canvas height), code in my update method resets it and places it back on the paddle.

However, the ball is supposed to be centered and placed 10px above the paddle.

The ball is being centered just fine but the gap is only 5 or 6px.

When I put the same update() method code into a ‘postupdate’ event listener (and comment out the scene update method), it works fine. The gap is exactly 10px as I want.

Any ideas?

```javascript
this.events.on('postupdate', function() {
  if (this.ball.y > (this.configData.world.height + this.ball.height)) {
    this.resetBall(this.ball);
    this.addBallToPaddle(this.ball, this.paddle);
  }
}, this);
```

```javascript
resetBall(ball) {
  ball.setVelocity(0);
  ball.x = ball.initialX;
  ball.y = ball.initialY;
}
```

```javascript
addBallToPaddle(ball, paddle) {
  ball.x = paddle.x;
  ball.y = paddle.y - (paddle.height + 10);
  
  ball.onPaddle = true;
}
```

---

<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 17, 2020, 4:00pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545/2 "2020-03-17T16:00:58Z")

</div>

Arcade Physics?

---

<div class="post-metadata">

**Author:** ![jmb272](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jmb272](https://phaser.discourse.group/u/jmb272)\
**Post date:** [March 17, 2020, 4:19pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545/3 "2020-03-17T16:19:31Z")

</div>

Yes, sorry I should have mentioned that.

---

<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 17, 2020, 4:32pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545/4 "2020-03-17T16:32:23Z")

</div>

I think you can do it in `update()` but use

```javascript
function resetBall(ball) {
  ball.body.reset(ball.initialX, ball.initialY);
}

```

---

<div class="post-metadata">

**Author:** ![jmb272](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jmb272](https://phaser.discourse.group/u/jmb272)\
**Post date:** [March 17, 2020, 4:38pm UTC](https://phaser.discourse.group/t/scene-postupdate-event-and-the-scene-update-method-problem/5545/5 "2020-03-17T16:38:00Z")

</div>

That fixed it. Thanks again samme, you’re my hero.
