# Problem with scale

**URL:** <https://phaser.discourse.group/t/problem-with-scale/2827>\
**Category:** Phaser 3\
**Created:** [June 19, 2019, 11:49am UTC](https://phaser.discourse.group/t/problem-with-scale/2827 "2019-06-19T11:49:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![k\_k](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@k\_k](https://phaser.discourse.group/u/k_k)\
**Post date:** [June 19, 2019, 11:49am UTC](https://phaser.discourse.group/t/problem-with-scale/2827/1 "2019-06-19T11:49:37Z")

</div>

I’ve just started my jurney with phaser with this tutorial https://phaser.io/tutorials/making-your-first-phaser-3-game/part1 . After completion I decided to change the character sprite. Unfortunately the spritesheet I’ve downloaded had frames of run animation only in one direction. I thought “No big deal I will just flip it”. And I did tried to do so like that:

```
           if (cursors.left.isDown)
           {
                player.scaleX = 1;
                player.setVelocityX(-160);
                player.anims.play('run', true);
           }
            else if (cursors.right.isDown)
           {
                player.scaleX = -1;
                player.setVelocityX(160);
                player.anims.play('run', true);
           }

```

At first it seems to work, animation changes direction as expected but:  
 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/e/ea82021334797b8c2d5b0311b1388f50b447f8aa.png) The game physics thinks my player is wider and detects collisions wrongly. I should just fall on the ground in the situation presented on the image, I can’t reach the wall nad collisions with the stars are occuring also way too soon. What is the couse of this behavior? What is the right way to “flip” the animation?

---

<div class="post-metadata">

**Author:** ![retroVX](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/retrovx/32/1491_2.png) [@retroVX](https://phaser.discourse.group/u/retroVX)\
**Post date:** [June 19, 2019, 2:09pm UTC](https://phaser.discourse.group/t/problem-with-scale/2827/2 "2019-06-19T14:09:29Z")

</div>

Hi,

To flip the player you can use `player.setFlipX(true);` and `player.setFlipX(false);` to flip back again.

Hope this helps 🙂
