# Sprites losing interactivity with tilemap game

**URL:** <https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698>\
**Category:** Phaser 3\
**Created:** [January 10, 2019, 9:46am UTC](https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698 "2019-01-10T09:46:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [January 10, 2019, 9:46am UTC](https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698/1 "2019-01-10T09:46:55Z")

</div>

Hello phaser’s guys,

I’m stuck with a strange problem :  
I have a “button/sprite” with interactivity which is nested in a container :  
const a = sena.add.sprite(0,100, ‘but’); a.setInteractive();  
myCont.add(a); myCont.setScrollFactor(0)

this container appears in a tilemap’s game at some moments.  
When the game initializes, sprite has interactivity.  
but as soon as the map (bigger than the scene) moves (adjusting to player’s move) my sprite’s button lost interactivity. I think the problem is due to “tilemap logic”, but can’t find the solution…

any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![digitsensitive](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/digitsensitive/32/349_2.png) [@digitsensitive](https://phaser.discourse.group/u/digitsensitive)\
**Post date:** [January 10, 2019, 5:13pm UTC](https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698/2 "2019-01-10T17:13:12Z")

</div>

Could it be that the sprite still scrolls? Turn debug mode to true in your game config.

---

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [January 10, 2019, 5:53pm UTC](https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698/3 "2019-01-10T17:53:58Z")

</div>

Thanks for your answer. On this screenshot below, interactivity works (yes/no button) but if the player walks a little (“making tilemap moving”), button is still showing but loses interactivity)

 ![capt](https://global.discourse-cdn.com/free1/uploads/phaser1/original/1X/566e7974ee2745726391c55680a3a612c5e8f3f9.jpeg)

I tried to follow your advice but debugging doesn’t seem to work with physics : it shows nothing.([http://www.html5gamedevs.com/topic/38408-phaser-3-debug-property-in-physics-not-drawing-debug-layer/](http://www.html5gamedevs.com/topic/38408-phaser-3-debug-property-in-physics-not-drawing-debug-layer/))

---

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [January 10, 2019, 6:25pm UTC](https://phaser.discourse.group/t/sprites-losing-interactivity-with-tilemap-game/698/4 "2019-01-10T18:25:33Z")

</div>

It seems there are these kinds of problems when setScrollFactor() is applied to several object (in my case the player and the container). To solve the problem, I had to remove setScrollFactor() method from the container containing my interactive sprites and replace it with a workaround (adjusting container coordonnates from player one’s). If someone has the explanation I am curious to know the reason!
