Skip to content

Unit Reference Increment Variable

RealityStop edited this page Mar 25, 2018 · 3 revisions

Increment Variable

Bolt - Increment Variable

The Increment Variable node is a convenience node roughly equivalent to the numerical '++' operator in C++ or C#. The Increment Variable node can replicate both pre-increment (++X) and post-increment (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 increment 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 incremented. To be clear, this means that the actual variable will be 1 greater than the value of pre. This is consistent with C#'s ++X behavior. |
  • post : Specifies what the numerical variable is after it is incremented. 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. |
Clone this wiki locally