Skip to content

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

Open
vincentfretin wants to merge 1 commit intoaframevr:masterfrom
vincentfretin:raycaster-camera
Open

Set raycaster.camera to the active camera in order to raycast against sprites#5801
vincentfretin wants to merge 1 commit 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

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.

1 participant