You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Learn why HUD must be a camera child — coordinate space and camera-relative layout #102
Comment in HUDNode.swift explains: SKCameraNode children stay fixed in screen space regardless of camera world position; HUD must be added as scene.camera?.addChild(hud).
Resolution:
The HUD must be added as scene.camera?.addChild(hud) because SKCameraNode children render relative to the camera's viewport rather than the scene's world coordinates. If the HUD were added directly to the scene, it would physically pan away off-screen whenever the camera moves to follow a projectile or preview a player. Making it a child of the camera ensures it stays perfectly glued to the screen.
Activity
Vallykrie commentedon May 18, 2026
Resolution:
The HUD must be added as
scene.camera?.addChild(hud)becauseSKCameraNodechildren render relative to the camera's viewport rather than the scene's world coordinates. If the HUD were added directly to the scene, it would physically pan away off-screen whenever the camera moves to follow a projectile or preview a player. Making it a child of the camera ensures it stays perfectly glued to the screen.