+1 vote

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

code of the call in the other class:


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 (15 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 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.