0
\$\begingroup\$

I'm trying to set a drag event on a phaser 3 group, but I wasn't able to achieve what I want. I was reading some phaser 2 blogs, and they said that it isn't possible to set a group a drag event. Can somebody help me with this? It's really impossible to set a drag event to a group?

\$\endgroup\$
0
\$\begingroup\$

First lemme explain the group behaviour here, the group game object does not have any shape or body as it is basically an Array of game objects Array<gameObject>. so it doesn't have any input events assigned.

What I suggest you is As group stores all its children data in a property called children, you iterate through the children and add your mouse event to the game objects.

Else add all your gameObject to the container and add mouse event to the container it gives you the expected result.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.