Sprite2d and label text independence

Godot Version

4.3

Question

I’m developing a game with characters that have attack and life points. For visual representation, I use Sprite2D and Labels to display their numerical values. The issue is that the Labels inherit the transformations of their parent node, so I introduced a CanvasLayer to separate the scaling, which worked for that issue. However, the Labels are now positioned incorrectly during runtime. What is the best way to solve this issue?

You can set “top_level” to true on the labels so they dont inherit the transformations of their parents.

1 Like

Thank you for your answer @herrspaten , I wasn’t aware of that.
In the meantime, I found an even easier solution. Simply connecting the label directly to the root node…

1 Like