0 votes

I have a Control Node and under it there is a textureProgress. I did a function in where i change the value. After it i print() it. In another class i called the function. The output says the right value but the progressBar does not update. So it is always saying 100%

code of the function:

onready var bar2 = $HealthBar2   

func _setDamage(damage):
bar2.value -= damage
print(bar2.value)

code of the call in the other class:

$HealthBar._setDamage(40)

If i change the value with a button which is in the same scene it works. But if i call the onButton_pressed() function on the other script it does not work!

in Engine by (14 points)
reshown by

Are you trying to update HealthBar or HealthBar2? Because your code only updates HealthBar2.

I am aware that only the second health bar should change here, but neither of them is changing

Can you post your node hierarchy?

I dont know how to delete the question but i found a solution..

You can still hide the question.

Please log in or register to answer this question.

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.
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 webmaster@godotengine.org with your username.