# Raycast demo click a cube in the grid to highlight the ray hit. ```{raw} html ▶ Run in browser ``` **Tags:** `3d` Fires a world-space ray from the camera through the mouse cursor using ``screen_to_ray`` and intersects it against a ``CollisionWorld`` populated with a grid of boxes. The ray and the closest hit are visualised with ``DebugDraw`` lines; the hit cube flashes yellow for a moment. This is the manual-ray approach. For the engine's built-in GPU object-picking buffer (``shape.pickable`` + ``on_picked``) see ``picking.py``. Controls: Left mouse - Cast a ray through the cursor Escape - Quit Run: uv run python examples/features/3d/raycast.py ## Source ```{literalinclude} ../../examples/features/3d/raycast.py :language: python :linenos: ```