How to make a 2D HUD that doesn't move?

Question

I’m facing an issue that doesn’t seem to be covered in any tutorials. I’m making a 2D fighting game, and I want players to be able to see their own cooldowns, and only their cooldowns. The cooldowns are set to timers that are attached to the player, because that makes the most sense.

However, if I make progress bars to show those cooldowns and attach it to the player, then whenever the player moves, the cooldown bars move with them. I would like the cooldown bars anchors to one position and only visible to the player that owns them.

The camera doesn’t move, all of the players will always be in view of the static camera, and there is no way for them to move out of the camera. How can I make this work? Before when I had multiple character nodes and just attached players to the already made nodes, I just had the cooldowns as a child of the root node rather than the character nodes. But now that I’m instantiating character nodes when players join, this isn’t possible.

Any ideas?

You can add a CanvasLayer as a child of the player, with all the player specific UI you want. Then set the CanvasLayer visible if authority.

1 Like

Would they need to make this canvas layer “top level” as well? An attached canvas layer would move with the player right?

No, CanvasLayers do not have transforms, they are implictly top-level

1 Like

I feel a bit stupid that it was this easy. Thanks a ton!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.