# TilemapLayer to overlap physics sprite

**URL:** <https://phaser.discourse.group/t/tilemaplayer-to-overlap-physics-sprite/8785>\
**Category:** Phaser 3\
**Created:** [February 2, 2021, 9:14am UTC](https://phaser.discourse.group/t/tilemaplayer-to-overlap-physics-sprite/8785 "2021-02-02T09:14:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virginsteele](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/virginsteele/32/4757_2.png) [@Virginsteele](https://phaser.discourse.group/u/Virginsteele)\
**Post date:** [February 2, 2021, 9:14am UTC](https://phaser.discourse.group/t/tilemaplayer-to-overlap-physics-sprite/8785/1 "2021-02-02T09:14:43Z")

</div>

Hi All,

I’m new to phaser (using phaser 3.50.1) and trying to generate random objects around the level.

The problem is I don’t want these objects to be spawned over on the tilemapLayer tiles. Attached is an image of the stars spawning over the tiles.

Before I added the tileMap, I was using

`this.physics.add.staticGroup();`

 ![question1](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/e/e35cc9d9fb63c6890365f197eabd7e2a1e458bef.jpeg)

with that I was able to check on the overlap with the walls in my method to add stars.

`this.scene.physics.overlap(walls, star)`

Now, with the tileset, I’m passing the tileMapLayer, but overlap is not detecting the tiles (picture, line 29)

How is the correct way to check for collisions/overlaps for tileMaps ?

Thanks,
