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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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