# Matter.js - How does overlapping work?

**URL:** <https://phaser.discourse.group/t/matter-js-how-does-overlapping-work/7397>\
**Category:** Phaser 3\
**Created:** [September 11, 2020, 3:19pm UTC](https://phaser.discourse.group/t/matter-js-how-does-overlapping-work/7397 "2020-09-11T15:19:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![progawski](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/progawski/32/3964_2.png) [@progawski](https://phaser.discourse.group/u/progawski)\
**Post date:** [September 11, 2020, 3:19pm UTC](https://phaser.discourse.group/t/matter-js-how-does-overlapping-work/7397/1 "2020-09-11T15:19:55Z")

</div>

Hello,  
I have been trying to understand how the overlapping with Matter.js works for few days and I think it’s a proper time to ask for help.

I would like to create a checkpoint. It should be detected when player pass through this checkpoint.

This is what I have at this moment:

```
create(){
...
this.player = this.matter.add.sprite(0, 0, "player");
this.checkpoint = this.matter.add.image(1000, 800, 'checkpoint').setIgnoreGravity(true);

this.matter.overlap(this.checkpoint, this.player, this.overlapInfo);
...
}

overlapInfo(){
        console.log("Overlap");
}

```

I found in the documentation that:

> Note that bodies can only overlap if they are in non-colliding collision groups or categories.

… so it tried with:

this.player.setCollisionGroup(-1);  
this.checkpoint.setCollisionGroup(-1);

but it does nothing and I don’t see any info about what is wrong. I am looking forward for your help!

**------ EDIT (SOLVED IN ANOTHER WAY) -------**

I have just set the checkpoint as a sensor and checked the collision in a standard way with w “collisionstart”. It works as it should, but I would like to get to know how to make it with overlap.
