# How do I check collision with a scaled tileSprite?

**URL:** <https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999>\
**Category:** Phaser 3\
**Created:** [October 18, 2019, 12:58pm UTC](https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999 "2019-10-18T12:58:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan-Pavel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/stefan-pavel/32/2197_2.png) [@Stefan-Pavel](https://phaser.discourse.group/u/Stefan-Pavel)\
**Post date:** [October 18, 2019, 12:58pm UTC](https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999/1 "2019-10-18T12:58:11Z")

</div>

Hi! 🙂

I saw [this](http://phaser.io/examples/v3/view/physics/arcade/add-body-to-tilesprite) example the other day and I was wondering why it doesn’t work as expected if I try to scaled it down. 🤨

Look at [this](https://codepen.io/stefanPavel/full/mddradv) codepen for a quick understanting of my problem.

Any thoughts? 🤔

---

<div class="post-metadata">

**Author:** ![scottwestover](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/scottwestover/32/7442_2.png) [@scottwestover](https://phaser.discourse.group/u/scottwestover)\
**Post date:** [October 18, 2019, 2:53pm UTC](https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999/2 "2019-10-18T14:53:42Z")

</div>

For the static block, you are giving that game object a static body here: `this.physics.add.existing(staticBlock, true);`. When a game object has a static body, any time you make changes to the game object, you have to manually update that game objects body.

Reference: [https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.StaticBody.html](https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.StaticBody.html)

Another solution is, you could give that game object a dynamic body and then update the `setImmovable` property, which will prevent the game object from moving.

Example:

```javascript
this.physics.add.existing(staticBlock, false);
// doesn't work as expected if it is put here
staticBlock.setScale(0.5);
staticBlock.body.immovable = true;

```

---

<div class="post-metadata">

**Author:** ![Stefan-Pavel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/stefan-pavel/32/2197_2.png) [@Stefan-Pavel](https://phaser.discourse.group/u/Stefan-Pavel)\
**Post date:** [October 18, 2019, 4:38pm UTC](https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999/3 "2019-10-18T16:38:29Z")

</div>

Hi, @scottwestover, thanks a lot for the example that you offered! It worked! I also tried the first solution, but now it appears that the game can’t “see” the collision at all. I guesses that by

> [@scottwestover](#):
>
> manually update that game objects body

you mean using the `staticBlock.refreshBody();` instruction as in [this](http://phaser.io/examples/v3/view/physics/arcade/static-body-update) example.  
Anyway, thanks again for your help! 🙂

---

<div class="post-metadata">

**Author:** ![Stefan-Pavel](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/stefan-pavel/32/2197_2.png) [@Stefan-Pavel](https://phaser.discourse.group/u/Stefan-Pavel)\
**Post date:** [October 18, 2019, 6:27pm UTC](https://phaser.discourse.group/t/how-do-i-check-collision-with-a-scaled-tilesprite/3999/4 "2019-10-18T18:27:51Z")

</div>

My mistake: I replaced

> [@Stefan-Pavel](#):
>
> staticBlock.refreshBody();

with `staticBlock.body.updateFromGameObject();` and now both solutions work as intended. 😊
