Parent of a child

Hi, everyone.
I am learning Phaser 3 and developed a simple game that the player collides either with a top group and a bottom group of objects.

I am using overlap to get the collision event, but I don’t know how to get the parent group of the collided objects.

As I didn’t find a solution, I deeped dive in the phaser.js and insert some small codes to gather this information.

My questions are:

  1. There is an official way to get the parent group information?

  2. If it not exists, how could I send the changes to be part of the official Phaser3 distribution, if it is possible?

:wave:

Groups are nonexclusive, so there isn’t necessarily a single parent.

It’s probably best to do this yourself, e.g.,

sprite.setData('parent', group);
1 Like

Hi, sammem
I didn’t know the use of setData()

Much more simple.
Thank you.