# Player shifts when camera moves

**URL:** <https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130>\
**Category:** Phaser 2 / CE\
**Created:** [February 8, 2019, 5:39am UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130 "2019-02-08T05:39:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![microspace](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/microspace/32/504_2.png) [@microspace](https://phaser.discourse.group/u/microspace)\
**Post date:** [February 8, 2019, 5:39am UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/1 "2019-02-08T05:39:38Z")

</div>

Hello! I’ve scaled down my game to 0.75 and now when I move camera around, player’s position shifts. This is code from create function

```
    this.game.world.scale.setTo(0.75, 0.75);
    this.scale.scaleMode = Phaser.ScaleManager.RESIZE;

```

![52254914-06c22080-2932-11e9-9f39-cc8f656c122e](https://global.discourse-cdn.com/free1/uploads/phaser1/original/1X/072f8e5ed91175eaff1728f76cddd82b57bc4209.gif)

---

<div class="post-metadata">

**Author:** ![nazimboudeffa](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nazimboudeffa/32/282_2.png) [@nazimboudeffa](https://phaser.discourse.group/u/nazimboudeffa)\
**Post date:** [February 8, 2019, 11:35am UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/2 "2019-02-08T11:35:07Z")

</div>

I think it happens because the sprite is scaled up or down the size of the world  
Are you scaling your sprite ?

---

<div class="post-metadata">

**Author:** ![microspace](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/microspace/32/504_2.png) [@microspace](https://phaser.discourse.group/u/microspace)\
**Post date:** [February 8, 2019, 12:04pm UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/3 "2019-02-08T12:04:53Z")

</div>

No, i don’t do anything with sprite. Tilemap and sprite is scaled down automatically at game init.

---

<div class="post-metadata">

**Author:** ![nazimboudeffa](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nazimboudeffa/32/282_2.png) [@nazimboudeffa](https://phaser.discourse.group/u/nazimboudeffa)\
**Post date:** [February 8, 2019, 2:16pm UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/4 "2019-02-08T14:16:51Z")

</div>

Are they both scaled with the same value or two diffrent ones

---

<div class="post-metadata">

**Author:** ![microspace](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/microspace/32/504_2.png) [@microspace](https://phaser.discourse.group/u/microspace)\
**Post date:** [February 9, 2019, 4:49am UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/5 "2019-02-09T04:49:42Z")

</div>

I didn’t understand you. I just do `this.game.world.scale.setTo(0.75, 0.75);` at game init and both player and tilemap is scaled down. No more scale operations are performed.

---

<div class="post-metadata">

**Author:** ![nazimboudeffa](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nazimboudeffa/32/282_2.png) [@nazimboudeffa](https://phaser.discourse.group/u/nazimboudeffa)\
**Post date:** [February 9, 2019, 2:31pm UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/6 "2019-02-09T14:31:45Z")

</div>

Sorry for the misunderstand, in fact you just shared a line of code and without more code I can’t understand how you did that it’s why I was asking more questions to clarify how you are coding your game, it was not clear how you scaled both the world and the sprite

I don’t know the solution, good luck

PS : Maybe you’ll have a better answer via [https://phaser.io/shop/premium-support](https://phaser.io/shop/premium-support)

---

<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 11, 2019, 4:50pm UTC](https://phaser.discourse.group/t/player-shifts-when-camera-moves/1130/7 "2019-02-11T16:50:18Z")

</div>

I’m not sure. Check the `worldScale` values of the objects to see if they’re the same.
