# Migration confusion (update, health, camera, etc.)

**URL:** <https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156>\
**Category:** Phaser 3\
**Created:** [February 12, 2020, 11:05pm UTC](https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156 "2020-02-12T23:05:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MegaBrutal](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/megabrutal/32/2774_2.png) [@MegaBrutal](https://phaser.discourse.group/u/MegaBrutal)\
**Post date:** [February 12, 2020, 11:05pm UTC](https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156/1 "2020-02-12T23:05:25Z")

</div>

I’m migrating from Phaser 2 CE to Phaser 3 and I find it quite confusing. Things that I used to in Phaser 2 just don’t exist or works differently.

1. The scene update method doesn’t call the updates of game objects. Now I need to call them manually which doesn’t feel right. Or am I supposed to call update() for all my objects?

2. If I want to use Arcade, do I need to extend Phaser.GameObjects.Sprite or Phaser.Physics.Arcade.Sprite? If I created an instance of my sprite, should I add it with scene.add.existing() or scene.physics.add.existing() or both?

3. I used to sprites having health/damage management by default. In Phaser 2, I have properties/methods like alive, health, damage(), kill(). It made many things easy. Phaser 3 seems to not have these members. Was this feature completely removed from Phaser 3, or is there a way to access it?

4. In Phaser 2 it was very easy to make the camera follow the player with game.camera.follow(). Now I have scene.cameras.main.startFollow(), but when I use this, I get a blank canvas. What is the proper way of doing this?

---

<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:** [February 13, 2020, 1:22am UTC](https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156/2 "2020-02-13T01:22:18Z")

</div>

[phaser3-faq](https://github.com/samme/phaser3-faq/wiki) covers some of these in detail.

1. The “automatic” way would be to use a group with [runChildUpdate](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Group.html#runChildUpdate), and there are some alternatives.

2. You could extend either but only Arcade.Sprite has all the relevant methods. If you use `scene.add.existing()` (instead of a factory method) then you should use `scene.physics.add.existing()` as well.

3. It’s not in Phaser but I recommend [phaser-component-health](https://github.com/samme/phaser-component-health) 😃.

4. [Camera follow](http://labs.phaser.io/view.html?src=src/camera%5Cfollow%20zoom.js) should work nearly the same.

---

<div class="post-metadata">

**Author:** ![MegaBrutal](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/megabrutal/32/2774_2.png) [@MegaBrutal](https://phaser.discourse.group/u/MegaBrutal)\
**Post date:** [February 17, 2020, 11:00pm UTC](https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156/3 "2020-02-17T23:00:30Z")

</div>

@samme Thank you very much, it helped a lot!

1. What if I add the sprite to the scene directly, not into a group? Well, `runChildUpdate` doesn’t work, but alternatively I could add an event handler for update:  
`this.events.on('update', player.update, player);`  
But if I need to have a group for using the more convenient `runChildUpdate`, it’s not a big deal either.

2. That worked perfectly! PhaserHealth adds very similar functionality than it was present in Phaser 2 (albeit not entirely the same, there are some notable differences, but it’s quite fine).

3. The mistake I made is that I also need to call `scene.cameras.main.setBounds()` before `startFollow()` for it to work.

Meanwhile I got an additional question.

1. I want to have static text on the canvas that is not affected by camera movements. In Phaser 2, the solution was to add the text to the stage (`game.stage`); but it seems there is no stage in Phaser 3. I found a FAQ entry that may probably apply here: [How can I make a game object stay the same size when the camera zooms?](https://github.com/samme/phaser3-faq/wiki#how-can-i-make-a-game-object-stay-the-same-size-when-the-camera-zooms). My situation is not entirely the same because I don’t need to zoom, just keep game objects at a fixed position on the canvas, though I’m not sure if it makes any difference regarding the solution. So do I need to create another scene to display fixed text or is there an easier way?

---

<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:** [February 18, 2020, 3:12am UTC](https://phaser.discourse.group/t/migration-confusion-update-health-camera-etc/5156/4 "2020-02-18T03:12:50Z")

</div>

1. For this you just use
