Unit Reference Decrement Variable - RealityStop/Bolt.Addons.Community GitHub Wiki

Decrement Variable

Bolt - Decrement Variable

The Decrement Variable node is a convenience node roughly equivalent to the numerical '--' operator in C++ or C#. The Decrement Variable node can replicate both pre-decrement (--X) and post-decrement (X--) forms. It is only valid on numerical variables (int or float)

The unit operates like a union of the Get and Set Variable nodes Bolt already offers. Of particular note, the unit takes a control flow input. This is for convenience, allowing the user to specify when the decrement should take place and to maintain the convention that variables should only change when the user indicates they should.

The output ports are somewhat different.

Output Ports

  • pre : Specifies what the numerical variable was before it was decremented. To be clear, this means that the actual variable will be 1 less than the value of pre. This is consistent with C#'s --X behavior. |
  • post : Specifies what the numerical variable is after it is decremented. If one was to do a "Get Variable" after the increment, they would get this modified value. This is consistent with C#'s X-- behavior. |
⚠️ **GitHub.com Fallback** ⚠️