Skip to content

Arcade Physics: Phaser.GameObjects.Line Does Not Collide In Group #4596

@andrewaustin

Description

@andrewaustin

Version

  • Phaser Version:

3.17.0

  • Operating system:

OS X

  • Browser:

Firefox 67.0

Description

When adding a Phaser.GameObjects.Line to a group that you then set up a collider with this.physics.add.collider(sprite, group);, the collision does not happen correctly. Instead if you turn on arcade physics debug, you see the line bounding box is in a weird place.

Since the Line object is the correct type to add to a group, I would expect collisions to work correctly. As demonstrated in the code, a workaround is to use a Rectangle, which works correctly, so it seems like an API inconsistency.

Example Test Code

Just press the up arrow on your keyboard and see the sprite does not collide with the line but does not with the group.

https://jsfiddle.net/9wrgta0s/

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