# Creating callback to a physics group

**URL:** https://phaser.discourse.group/t/creating-callback-to-a-physics-group/4039
**Category:** Phaser 3
**Created:** [October 24, 2019, 2:54am UTC](https://phaser.discourse.group/t/creating-callback-to-a-physics-group/4039 "2019-10-24T02:54:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scubdade](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/scubdade/32/2210_2.png) [@scubdade](https://phaser.discourse.group/u/scubdade)
#### Post date: [October 24, 2019, 2:54am UTC](https://phaser.discourse.group/t/creating-callback-to-a-physics-group/4039/1 "2019-10-24T02:54:32Z")

</div>

I think there is a problem with adding callbacks for physics.group.  
Whenever I do this

```
enemyGroup = this.physics.add.group({
        defaultKey: 'enemy',
        maxSize: 5,
        createCallback: function(enemy){
            enemy.setData('health',3);
            console.log(enemy.getData(health));
        },
    });

```

the callback doesnt trigger but when i change `this.physics.add.group` to `this.add.group` the callback fires. Is this a bug on Phaser 3? if so is there a work around?

---

<div class="post-metadata">

### Author: ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)
#### Post date: [October 24, 2019, 5:30pm UTC](https://phaser.discourse.group/t/creating-callback-to-a-physics-group/4039/2 "2019-10-24T17:30:00Z")

</div>

Physics use their own createCallback internally, and ignore any passed in the config.

But you can override it. See

> <https://github.com/photonstorm/phaser/issues/4657>
>
> Version
> Phaser Version: 3.18.1
> Operating system: Mac OS
> Description
> I'm having an issue related to #4420, but with createCallback on Physics group. createCallback is never...
