how to change properties of child in tool mode?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By icqqq

say I have a gui component and the layout like below:

I have script for the HBoxContainer and export a value called hp
and I want to make the HBoxContainer in tool mode so that when I change the hp
I can see the textureprogress reflect the hp value in editor.

However I don’t know how to do it.
Can anyone help me?

:bust_in_silhouette: Reply From: joakim1999

The editor triggers setters for variables when you change them. You can therefore make a setter that updates the TextureProgress.

You could of course also use the _process function and check if the value had changed on each update, but you may have to restart the editor for the changes in the code to take effect.