> For the complete documentation index, see [llms.txt](https://levelalfaomega.gitbook.io/unity-mugen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://levelalfaomega.gitbook.io/unity-mugen/unity-mugen/state-controller-reference/varadd.md).

# VarAdd

Adds to one of the player's working variables. Either a float variable or an int variable can be added to by this controller.

### Required parameters (int version):

&#x20;          v = *var\_no* (int)

&#x20;                     *var\_no* specifies the number of the variable to affect. It must evaluate to an integer between 0 and 59.

&#x20;          value = *int\_expr* (int)

&#x20;                     *int\_expr* specifies the value to add to the int variable indexed by *var\_no*.

### Required parameters (float version):

&#x20;          fv = *var\_no* (int)

&#x20;                     *var\_no* specifies the number of the variable to affect. It must evaluate to an integer between 0 and 39.

&#x20;          value = *float\_expr* (float)

&#x20;                     *float\_expr* is the value to add to the float variable indexed by *var\_no*.

### Optional parameters:

&#x20;          none in both cases

### Alternate syntax:

&#x20;          var(*var\_no*) = *int\_expr* (int version)

&#x20;          fvar(*var\_no*) = *float\_expr* (float version)

### Notes:

&#x20;          Due to historical reasons, note that the alternate VarAdd syntax listed above matches neither the syntax for variable assignment within an expression, nor the syntax for variable addition within an expression.

&#x20;          If you have placed P2 in a custom state through a successful hit, do not use variable assignment within the custom states. Otherwise, you will overwrite P2's variables, which can cause unintended malfunction of the opponent player.
