Variables are used to store values of attributes of Blueprints that can be modified during the execution of the game. To create variables use the "MyBlueprint" tab and click the button with the "+" symbol next to the "Variables" category. The images below show the "MyBlueprint" tab and the variable types that exist in Unreal Engine.
|Click to enlarge|
The simplest types of variables are:
- Boolean: A boolean variable can only hold the values "true" or "false".
- Integer: Type of variable used to store integer values.
- Float: Type of variable used to store fractional values.
- String/Text: These types are used to store text. Prefer the Text type since it supports internationalization.
The "Editable" option selected means that the variable can be changed in the level editor. The default value of this variable is 20, but the level designer can easily change the amount of ammunition of each box in the level.