The Godot Community Forums are back up and running! Please read the the announcement post for important information on what happened. Thanks!

How to decrease the ProgressBar value from code?

TudorTudor Posts: 35Member

Hello! I want to decrease the ProgressBar value from code, in order to implement health loss.

I tried to find a function, for example: "value()" or "set_value()" or "change_value()", that controls the ProgressBar value, but I didn't find anything.

How could I do that?

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 3,129
    edited September 5 Accepted Answer

    You can manipulate the value property to increase or decrease a ProgressBar from code. The value property is inherited from the Range class, which ProgressBar extends :smile:

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 3,129Admin
    edited September 5 Accepted Answer

    You can manipulate the value property to increase or decrease a ProgressBar from code. The value property is inherited from the Range class, which ProgressBar extends :smile:

  • TudorTudor Posts: 35Member

    Thank you for the hint!

    I use "set_value()" function (a setter of "value()" property), in order to manipulate the value of ProgressBar :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file