How to get value of node slider?

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

I want get the value of HSlider and display this on Label node

:bust_in_silhouette: Reply From: Adrasteon

You can use a signal

  • Add a script to the Label node
  • Click on the HSlider node and double click on the “value_changed” signal (in the node tab)
  • On the popup, click on the label node
  • Click on the “Connect” button
  • Add this line of code in the ready function of the Label script:
text = "0" # initial value
  • Add this line of code in the function that was created by the popup (it should be a function like _on_h_slider_value_changed):
text = str(value)