# Pass data between scenes

**URL:** <https://phaser.discourse.group/t/pass-data-between-scenes/7070>\
**Category:** Phaser 3\
**Created:** [August 2, 2020, 7:05am UTC](https://phaser.discourse.group/t/pass-data-between-scenes/7070 "2020-08-02T07:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marvin](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/marvin/32/3788_2.png) [@Marvin](https://phaser.discourse.group/u/Marvin)\
**Post date:** [August 2, 2020, 7:05am UTC](https://phaser.discourse.group/t/pass-data-between-scenes/7070/1 "2020-08-02T07:05:33Z")

</div>

Hello,

I have a class custom object in my GameScene.

this.player = new Player(  
this,  
this.game.config.width \* 0.5,  
this.game.config.height \* 0.5,  
“playerShip”  
);  
This object have lives and score. Which is the best way to pass all the player data into another scene?

---

<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:** [August 2, 2020, 9:01am UTC](https://phaser.discourse.group/t/pass-data-between-scenes/7070/2 "2020-08-02T09:01:05Z")

</div>

Hi,

In scene A:

```javascript
this.scene.events.emit('playerData', { data: this.player.data });

```

In scene B:

```javascript
this.mainScene = this.scene.get("sceneA name");
this.mainScene.events.on('playerData', (data) => {
  // your code
});

```
