Canvas & Ray Casting
intermediate conceptsX-Frame FPS Accelerator · Core Concepts
Canvas and Ray Casting
X-Frame automatically manages ray casting for Canvas elements set to Screen Space Overlay or World Space.
ScreenPointToRay Replacement
If you experience issues with Camera.ScreenPointToRay, use the X-Frame equivalent instead. It accounts for the active downsampling factor:
Ray ray = XFrameManager.instance.ScreenPointToRay(camera, screenPosition);
Runtime-created Canvas Objects
If you create Canvas objects at runtime, call UpdateUICanvases() to integrate them with X-Frame's ray casting system:
XFrameManager.instance.UpdateUICanvases();
See the Scripting Support page for the full API reference, including additional raycast and UI interaction helpers.
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.