Skip to content

Learn why HUD must be a camera child — coordinate space and camera-relative layout #102

Closed

Description

@chowjustin

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).

Activity

  1. moved this from Backlog to In progress in QuackFight Backlogon May 18, 2026
  2. Vallykrie commented on May 18, 2026

    @Vallykrie
    Member

    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.

  3. moved this from In progress to Done in QuackFight Backlogon May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions