feat: Report the resolved camera in raycast responses#1904
Conversation
Camera.main can resolve to a different GameObject than the one an agent expects when a scene has multiple MainCamera-tagged cameras. A round5 dogfooding session hit exactly this: raycast kept reporting "No physics hit" and there was no way to tell which camera the ray had actually been cast from. - Add CameraName/CameraPath to RaycastResponse, populated from the same Camera.main GameViewRaycastUtility already resolves - Thread the resolved Camera through GameViewRaycastResult so RaycastTool can report it on both the hit and no-hit paths (a no-hit response needs the camera identity just as much as a hit does, since that's the case round5 actually got stuck on) - Extend RaycastToolTests to cover both paths
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe raycast pipeline now retains the resolved camera and returns its name and hierarchy path for both collider hits and misses. Editor tests verify camera metadata alongside hit results. ChangesRaycast camera metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2b68047
into
feature/pause-point-round5-integration
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
raycastnow reports which camera the ray was actually cast from, on every response (hit and no-hit alike).User Impact
MainCamera-tagged camera,Camera.maincould resolve to a camera the agent didn't expect, and a "No physics hit" response gave no way to tell which camera was actually used. A round5 dogfooding session got stuck on exactly this.CameraNameandCameraPathfor the resolved camera, so a surprising "no hit" can be diagnosed immediately instead of assuming the intended camera was used.Changes
CameraName/CameraPathtoRaycastResponse(additive, existing fields unchanged).Camera.mainthroughGameViewRaycastUtility's result soRaycastToolcan report it on both the hit and no-hit paths.Verification
dist/darwin-arm64/uloop compile --project-path .— 0 errors, 0 warnings.dist/darwin-arm64/uloop run-tests --filter-type regex --filter-value RaycastToolTests --test-mode EditMode— 6/6 passed.dist/darwin-arm64/uloop run-tests --filter-type regex --filter-value Raycast --test-mode EditMode— 54/54 passed (full regression across raycast-related tests).CameraName/CameraPath), then implemented and re-ran to green.