![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | h5n1xp |
When having the HUD as a child of the main player, when smoothing is enabled the hud elements appear to drift around the screen.
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | h5n1xp |
When having the HUD as a child of the main player, when smoothing is enabled the hud elements appear to drift around the screen.
![]() |
Reply From: | rossunger |
You might want to make your HUD a child of a CanvasLayer node so it’s not affected by your camera
I grouped my HUD elements as children of a canvas layer node, which itself is a child of my main player and it works! Cheers
Pseudo Hierarchy:
Root
⠀|
⠀|—Player
⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀|----- PlayerSprite2D
⠀⠀⠀⠀⠀|⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀|⠀⠀⠀⠀⠀|------ WeaponSprite2D
⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀|----- Camera2D
⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀|----- HUDCanvasLayer
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|----- HealthSprite2D
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|----- WeaponSelectionSprite2D
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|----- InventorySprite2D
h5n1xp | 2022-02-14 12:30