Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect raycast results against CollisionPolygon2D with build_mode = BUILD_SOLIDS #32

Closed
Pizzaandy opened this issue Feb 11, 2024 · 2 comments · Fixed by #43
Closed
Labels
bug Something isn't working

Comments

@Pizzaandy
Copy link

Pizzaandy commented Feb 11, 2024

Describe the bug
Raycasts sometimes tunnel through polygon shapes with the "Solids" build mode.

To Reproduce
I've attached a project demonstrating the behavior. Simply move the mouse around to see the difference between raycasting against solids vs segments.

Expected behavior
Raycasts against polygons with build_mode = BUILD_SOLIDS should behave approximately the same as raycasts against polygons with build_mode = BUILD_SEGMENTS.

Screenshots
Blue = Raycast result against segments
Orange = Raycast result against solids
raycast_error

Environment

  • OS: Windows
  • Version v0.5.1
  • Godot Version v4.2.1

RaycastDemo.zip

@Pizzaandy Pizzaandy added the bug Something isn't working label Feb 11, 2024
@Pizzaandy Pizzaandy changed the title Incorrect Raycast Results for CollisionPolygon2D for "Solids" Build Mode Incorrect raycast results against CollisionPolygon2D with build_mode = BUILD_SOLIDS Feb 11, 2024
@Ughuuu
Copy link
Contributor

Ughuuu commented Mar 28, 2024

Could be related to #33

@Ughuuu
Copy link
Contributor

Ughuuu commented Mar 29, 2024

My guess here is that it finds more than one result and it doesnt send the closest one. Looking into it.

Ughuuu added a commit that referenced this issue Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants