Fix issue with RayCaster when max_hits is set to 1#869
Merged
Conversation
Jondolf
approved these changes
Oct 20, 2025
Jondolf
left a comment
Member
There was a problem hiding this comment.
Oof, not sure how that bug happened 😬 Looks like it was introduced by #815, and I somehow didn't realize that it wasn't actually pushing the result.
I'll most likely do a 0.4.1 patch release this weekend; there's a few other small bugs that would be good to fix too.
We don't have good automated tests for spatial queries yet, though it would be good to have them. But we don't need to do that in this PR, I opened #871 to track it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #868
Solution
Make sure the ray cast result is pushed into the
RayHitscomponent.Testing
I tested this locally against my own project, and it fixed the issue.
You can test this yourself by spawning a
RayCasterwith max_hits set to 1, and ensuring that theRayHitscomponent gets updated with the result.Are there unit tests or similar that I can add a test case to?