0 votes

I am trying to get my player's health to go down when a slime touches it. I already have the code for that, and I am trying to get a label to display the health variable, but it won't change. Any suggestions? Here is the line of code that should change the text:

$Node2D/HPValue.text = str(health)
asked Aug 2, 2018 in Engine by ThreeSpark (88 points)

1 Answer

0 votes

Make sure you are calling this line of code in process() or _fixedprocess() or physicsprocess() so that it is updated every frame. Just calling it in _ready() will only call it once when the parent node is added to the scene.

answered Aug 2, 2018 by Diet Estus (1,504 points)

It is in _process(delta)

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 How to use this Q&A? before posting your first questions.