Need help implementing a speedrun timer to a 2D platformer

Godot Version

Godot 4

Question

Hello! I am just starting out in game development and learning Godot. I just did Brackeys tutorial on making the 2D platformer. I’ve completed the tutorial, and my friends challenged me to add coyote time and a speedrun timer to the game. Coyote time I was able to figure out with a YT tutorial.
I want the speedrun timer to start when you respawn, and stop when you have collected 9 coins. The timer script I’m relatively confident I can figure out, but I cannot for the life of me figure out how to properly display the label for the timer.
Whenever I attach it to the main scene, as a child of the game node it stays statically in place in the world, and as a child of the player or camera node it just follows next to the player. I just want it to sit at the bottom right of the screen. I tried making a canvas layer and all that but then I can’t get the label sample text to show up when I run the game, even when I increase the z index number for the ordering. Thank you to anyone who can help!

Can you post the code / scene tree where you try it with the canvas layer. That’s the right approach. There’s a good chance you don’t have the anchors or container layout set right… for example, if set wrong it could be displaying “outside” the viewport.

Like the picture in the bottom of this page: Size and anchors — Godot Engine (stable) documentation in English.

Which layout are you trying?

You might want to experiment with different approaches, but off the top of my head, i would first put an hboxcontainer with the bottom wide preset layout. Then put your label in that with shrink right and fill toggled on for the horizontal settings (under transform > container sizing) . You should not have to, but you can also set the custom mi nwidth and height.

You should clearly see your label in the desired location in the viewport box in the editor scene display before even running the game.