Skip to content

Adding game object to layer ignores any depth settings for input #5483

@pr4xx

Description

@pr4xx

Version

  • Phaser Version: 3.50.1
  • Operating system: macOS
  • Browser: Firefox

Description

I have two sprites with setInteractive. I give them a specific depth for the correct draw order because they overlap.
Without a layer, everything works as expected.
But as soon as I add the sprites to a layer (one layer for all sprites), the depth will be ignored for any input related stuff.
Check out the codepen below.

Example Test Code

https://codepen.io/pr4xx/pen/dypmWZm

There are two sprites. The first one is below the second one. But when I click the second one, the first sprite catches the input event. But ONLY when using the layer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions