Jump to content

Raycast with P2 physics only hitting world bounds, not bodies


darkf
 Share

Recommended Posts

Runnable code here: https://github.com/darkf/grr

I'm using P2 physics and I'm trying to raycast to the mouse position. I've got a tilemap with physics bodies set up, and they show fine with debug draw on.
However, the ray never hits any of the tile bodies, nor the player body. It only hits the top and left side of the world bounds.

Screenshots attached.

Is there anything obvious I'm doing wrong, or is this a bug?

2016-05-10_00-10-19.png

2016-05-10_00-10-31.png

Link to comment
Share on other sites

1 hour ago, rich said:

I'm confused, which are you using, p2 or Box2D? Because the second message implies Box2D, but the first P2. They're not interchangeable.

I'm using P2 myself. My second post was remarking that the Box2D example is also similarly broken -- so it might be a Phaser issue rather than a P2/Box2D one.

Link to comment
Share on other sites

  • 7 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...