• 2D
  • How to make a Texture progress node stay in the corner of the camera?

I don't know how i can make a texture progress node which means the life circle and the stamina circle(I am using circles instead of bars in my game cause they are way cooler) stay in the corner of the camera. I found a similar question before (idr if it was on reddit or godot-forums) but it didn't answer my question. There was a single answer: "Use canvas-layer node". Idk how to use the canvas layer node to make the texture progress stay in the corner. BTW the life-bar is a totally different scene with just a single node(the root node of the scene) which is the texture progress node.

You might want to read the articles on this page: https://docs.godotengine.org/en/stable/tutorials/ui/index.html

Basically you use Control nodes to adjust the position (and also the layout button on the mid top of the editor). You can also use a CanvasLayer so the UI does not move with the Camera. But it's kind of confusing, so please read those articles.

@cybereality said: You might want to read the articles on this page: https://docs.godotengine.org/en/stable/tutorials/ui/index.html

Basically you use Control nodes to adjust the position (and also the layout button on the mid top of the editor). You can also use a CanvasLayer so the UI does not move with the Camera. But it's kind of confusing, so please read those articles.

The thing is that my camera is a child of the player and the lifebar needs to stay in the corner of the camera so it needs to be its child but it just doesn't work. If the lifbar is over the player, and the player moves right, the lifebar starts moving as well. I only want it to move when the camera moves,not the player.

It should work, but you probably want to have the player and camera on the same level and just have the camera follow the player. Usually making the camera a child of a moving object is not a good idea.

@cybereality said: It should work, but you probably want to have the player and camera on the same level and just have the camera follow the player. Usually making the camera a child of a moving object is not a good idea.

OK i made it so that the camera position will be changed to the player's position every physics_frame. But then if i make the life-bar the camera's child it still changes its position whenever the player moves. I don't know if its cause i have my camera's limit at 0 left. And the player can't get farther than 0 in the x axis to the left cause of a wall. I doubt that's the problem.

The life bar should be under a CanvasLayer on the root of the scene. The CanvasLayer makes things stay in the same place.