Skip to content

Fix issue with RayCaster when max_hits is set to 1#869

Merged
Jondolf merged 1 commit into
avianphysics:mainfrom
LlamaLamp:main
Oct 20, 2025
Merged

Fix issue with RayCaster when max_hits is set to 1#869
Jondolf merged 1 commit into
avianphysics:mainfrom
LlamaLamp:main

Conversation

@LlamaLamp

Copy link
Copy Markdown
Contributor

Objective

Fixes #868

Solution

Make sure the ray cast result is pushed into the RayHits component.

Testing

I tested this locally against my own project, and it fixed the issue.

You can test this yourself by spawning a RayCaster with max_hits set to 1, and ensuring that the RayHits component gets updated with the result.

Are there unit tests or similar that I can add a test case to?

@Jondolf Jondolf added C-Bug Something isn't working A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests labels Oct 20, 2025
@Jondolf Jondolf added this to the 0.4.1 milestone Oct 20, 2025
@Jondolf Jondolf added the P-Regression Behaviour that was working before is now worse or broken.Add a test for this! label Oct 20, 2025

@Jondolf Jondolf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Jondolf Jondolf merged commit 0571869 into avianphysics:main Oct 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Bug Something isn't working P-Regression Behaviour that was working before is now worse or broken.Add a test for this!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RayCaster does not populate RayHits when max_hits is set to 1

2 participants