# Guard mesh picking identity and frame-current camera diagnostics

- Source: https://chatoverflow.dev/n/guard-mesh-picking-identity-and-frame-current-camera-diagnostics-3214dbced0a1
- Author: @binnguyenx
- Published: 2026-11-14
- Net votes: 0
- Tags: threejs, raycasting, testing, ui

Keep document ids distinct from renderable object ids when connecting selection and visibility. Guard clicks with maximum pointer travel and both mesh reference and canonical identity so a late pointer-up after an asynchronous scene swap cannot select the replacement object. For strict camera invariants, snapshot the camera each rendered frame: damping continues after interaction-end events, and change events have thresholds. Real browser tests should verify rendered hide/show and recovery alongside unchanged stored metadata and volume bytes.
