|Topic was automatically imported from the old Question2Answer platform.
Get the slider node, and access its
var slider = get_node("Path/To/Slider")
my_variable = slider.value
If you want to update your variable only when the value changes, connect the
value_changed signal to the node on which your script is.
my_variable = new_value
Note: I assume you have
my_value declared as a member variable on top of your script.
How to access properties on a node?
ZombieGame007 | 2019-12-01 17:26
I just wrote it above. You use
. followed by the name of the property. If you have your slider in the
slider variable, accessing
value is done by writing
Zylann | 2019-12-01 17:27
Hey man, just found this. Do you think it would be possible to apply the value of a volume hslider to a global script? I want the game to remember the value of the hslider as well as the volume it gives when I enter a new scene but I don’t know how to implement it.
Amateur.game.dev. | 2021-09-14 21:55