0 votes

So i am creating a 2d platformer and to the player (kinematicbody2d) i added a script so that when i move left or right , the whole body will scale by -1 so as to make the character face the correct direction(by flipping the entire body).I had a camera attached to the body as a child and there is no visible issue or anything even though the camera is also flipping with the character. But the problem is, i want to show a label depicting Player's health on screen.When i child it to the camera, whenever the player changes direction, as the camera flips, the label also flips(in other words, gets scaled by -1).Is there any way i can show the label on screen always but not be affected by the camera in anyway or do i have to start over everything??I want the cam to always follow the player.

Godot version Godot 3.2.3
in Engine by (16 points)

2 Answers

+1 vote

It looks like you want to create a GUI. Don't attach the health label to the camera. Instead, put it on a separate CanvasLayer that won't be affected by the camera movement. There are some cool GUI tutorials in the official docs.

by (7,839 points)
0 votes

You must use for example a Label on a Control Node. Here is a Video https://www.youtube.com/watch?v=pVK_QzQPv4o&t=96s

by (255 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.