How could I read float input from the user?

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

How can I get float input from the user?

I figured out a way to do this using get_node and LineEdit.

Thanks for the answers folks.

GodotUser | 2019-07-09 03:26

:bust_in_silhouette: Reply From: Magso

It would be easier to create a TextEdit node and use float(your_text_edit_node.text)

I did figure out a way to make it work. I will look into the TextEdit method you mention. Maybe it works better.

Thanks much!

GodotUser | 2019-07-08 02:09

:bust_in_silhouette: Reply From: Calinou

To read a numeric value (integer or float), the recommended way is to use a SpinBox node. This way, input is automatically restricted to numbers and you can specify a minimum/maximum value.