Articles on: Blocks Creator
This article is also available in:

🟦 Decrement

🟦 Decrement



Decrement


The Decrement block allows you to subtract a precise value from a Number type variable, providing a convenient shortcut for operations like removing life points, decreasing a counter or adjusting a balance without manual calculation.


This block simplifies arithmetic operations by automating subtraction (variable = variable - value), thus avoiding errors and speeding up flow design.


πŸ“₯ Entries


  • variable (Number): The targeted numeric variable, previously defined in the project. When it is chosen in the editing window and nothing is wired to variable or value, the block is drawn compact as Β« variable - value Β» with only in and out: the variable and the value are then set in the editing window.
  • value (Number): The number to subtract from the variable (default: 1).


πŸ“€ Outings


  • out (Stream): The output flow that activates after the decrement is successful.


πŸ’‘ Example of use


Scenario: Management of life points in a game


  1. The player takes damage after an enemy attack.
  2. The system checks that the life points (player_pv) are greater than 0.
  3. The Decrement block is called with:


  • variable = player_pv (current value: 30).
  • value = 5 (damage inflicted).


  1. The player_pv variable changes to 25.
  2. The output stream (out) triggers a check to display a message ("Damage taken!") or activate a visual effect.


βš™οΈ Technical Details


  • Behavior: The decrement is immediate and directly modifies the target variable. No type validation is performed (make sure variable is of type Number).
  • Default value: If value is not specified, the subtraction is 1.



Documented version: v1

Updated on: 23/09/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!