Hello! I want to make a Health bar (ProgressBar node) to be visible on the First-person viewport, like in the image below (I drew the healthbar on the screenshot):

It would also be good if this health bar would be visible only for the player.
In order to bring the health bar in the 3d scene, I tried the following steps:
I created the hierarchy: Sprite3D -> Viewport -> ProgressBar
I made the Viewport size to be similar to the Progress bar size.
* I attached a script at the Sprite3D node, with the following code:
extends Sprite3D
func _ready():
texture = $Viewport.get_texture()
But, no progress bar appears in the scene.
How should I do this?