Skip to content

Set raycaster.camera to the active camera in order to raycast against sprites#5801

Merged
dmarcos merged 3 commits intoaframevr:masterfrom
vincentfretin:raycaster-camera
Apr 3, 2026
Merged

Set raycaster.camera to the active camera in order to raycast against sprites#5801
dmarcos merged 3 commits intoaframevr:masterfrom
vincentfretin:raycaster-camera

Conversation

@vincentfretin
Copy link
Copy Markdown
Contributor

Description:

Set raycaster.camera to the active camera in order to raycast against sprites.

Changes proposed:

  • Set raycaster.camera before calling raycaster.intersectObjects, set it back to null afterwards to be sure to not keep eventually a removed camera on it

I need that for the inspector to not give an error when hovering over some flame I got from the webgpu_tsl_vfx_flames example
Capture d’écran du 2026-03-30 19-15-34
otherwise you get the error Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites. from https://github.com/mrdoob/three.js/blob/87c407b70235a6cdf64f96fa3f74d6fb9b0ccbbc/src/objects/Sprite.js#L133

@dmarcos dmarcos merged commit 71db798 into aframevr:master Apr 3, 2026
1 check passed
@vincentfretin vincentfretin deleted the raycaster-camera branch April 3, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants