godot-rapier-2d icon indicating copy to clipboard operation
godot-rapier-2d copied to clipboard

RayCast2D fails to collide if body is inside a CanvasLayer

Open jamesresend opened this issue 10 months ago • 4 comments

Describe the bug

RayCast2D fails to collide if body is inside a CanvasLayer

To Reproduce

1 - Raycast a body that is inside a CanvasLayer and the detection is missed.

https://github.com/user-attachments/assets/56a4ec6a-49db-4259-998b-02986fc56cd6

Image

Expected behavior

With the default Godot physics this detection is possible.

Environment:

  • OS: Windows 11 23H2
  • Version: 0.8.8
  • Godot Version: v4.3.stable.steam.77dcf97d8 | 4.4 beta 3
  • Type: Slower Version - 2D

Example project(zip)

mvp.zip

jamesresend avatar Feb 12 '25 18:02 jamesresend

Try with latest master build also and let me know if it happens.

Ughuuu avatar Feb 12 '25 19:02 Ughuuu

Try with latest master build also and let me know if it happens.

It still happens -> version="0.8.10" flavour="godot-rapier-2d-single-enhanced-determinism"

https://github.com/user-attachments/assets/97cf6904-cfbb-4f5d-beba-f44374d19e82

jamesresend avatar Feb 12 '25 19:02 jamesresend

In my project I found another use case where CanvasLayer is messing up. A direct_space_state.intersect_ray() also breaks. But intersect_point() works fine.

  • Godot Engine v4.3.stable.steam.77dcf97d8
  • Rapier2D v0.8.10 "godot-rapier-2d-single-enhanced-determinism"

https://github.com/user-attachments/assets/eca9aeb5-07f7-4c46-938a-cf72adc095a6

mvp2.zip

EDIT: Also tested intersect_shape() and it doesn't work.

Thank you.

jamesresend avatar Feb 13 '25 19:02 jamesresend

I had the same thing and I though I was going crazy ty for reporting

JagersEgo avatar Feb 22 '25 11:02 JagersEgo

Image

Fixed in https://github.com/appsinacup/godot-rapier-physics/pull/420.

dog-molecule avatar Nov 02 '25 14:11 dog-molecule