# Restart scene issue

**URL:** <https://phaser.discourse.group/t/restart-scene-issue/2657>\
**Category:** Phaser 3\
**Created:** [June 4, 2019, 10:55am UTC](https://phaser.discourse.group/t/restart-scene-issue/2657 "2019-06-04T10:55:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eclipse](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@eclipse](https://phaser.discourse.group/u/eclipse)\
**Post date:** [June 4, 2019, 10:55am UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/1 "2019-06-04T10:55:09Z")

</div>

I have one game scene, with background music. When the tab is out of focus, i’ll restart the game by using this.scene.restart();music.stop().

The problem is when i restart the game, the background music get doubled, it is very obvious there’s two same bgm where one is slower than the other. The more times i restart the game, the more bgm echoing. The same goes for some tween animation…

Any idea how may i solve it?

---

<div class="post-metadata">

**Author:** ![Benstrocity](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Benstrocity](https://phaser.discourse.group/u/Benstrocity)\
**Post date:** [June 4, 2019, 4:10pm UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/2 "2019-06-04T16:10:39Z")

</div>

Are you calling music.stop(); in your update function?

---

<div class="post-metadata">

**Author:** ![eclipse](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@eclipse](https://phaser.discourse.group/u/eclipse)\
**Post date:** [June 5, 2019, 2:25am UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/3 "2019-06-05T02:25:05Z")

</div>

Yes, i have something like this in my update function

update() {  
if (restart) {  
music.stop();  
this.scene.restart();  
restart = 0;  
}  
}

---

<div class="post-metadata">

**Author:** ![Benstrocity](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Benstrocity](https://phaser.discourse.group/u/Benstrocity)\
**Post date:** [June 5, 2019, 3:07pm UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/4 "2019-06-05T15:07:49Z")

</div>

Depending on how your code is structured, you may need to specify the object of music and try `this.music.stop();`

---

<div class="post-metadata">

**Author:** ![eclipse](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@eclipse](https://phaser.discourse.group/u/eclipse)\
**Post date:** [June 7, 2019, 8:14am UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/5 "2019-06-07T08:14:38Z")

</div>

Turn out i’d been declaring the same music twice.

var music = this.sound.add(‘music’);

Problem solved… Thanks!

---

<div class="post-metadata">

**Author:** ![Benstrocity](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Benstrocity](https://phaser.discourse.group/u/Benstrocity)\
**Post date:** [June 7, 2019, 9:17am UTC](https://phaser.discourse.group/t/restart-scene-issue/2657/6 "2019-06-07T09:17:02Z")

</div>

Awesome. Good work
