In this example, we have a Blueprint Actor that has two spot lights set up. The color of each spot light is controlled by a variable. In programming, a variable is defined as a location in the computer's memory that stores some amount of data. In Blueprint scripts, variables are used in precisely the same way as virtual containers into which we can place, and out of which we can query, some kind of information. In this case, each light in our example uses a Linear Color variable, which stores an RGB value for a specific color. We can put in default values for this color, query it to use it in various locations, and set new colors to it, all as parts of our Blueprint script.
Although in this example we are using primarily Linear Color variables, there are many different types of variables available for use within your Blueprint scripts. Each type of variable holds a different type of data, and it will be important for you to have at least a basic understanding of what the primary data types are. For a list of these types and more information about variable usage, please see the Blueprint variables documentation.
On the left spot light, this variable has been made public, meaning that it will be editable within the Details panel while the Blueprint Actor is selected. On the right is a similar setup, but with the Linear Color variable remaining private. This means that in order to change the color value, one would need to open up the Blueprint script for the Actor and change the default setting for the private variable, or change it some other way as a part of the script's functionality.
Making a variable public simply requires that you check its Editable property, or click the eye icon next to a variable's name in the My Blueprint window. Once a variable is editable, the eye-shaped button next to it will highlight yellow. This indicates that although the variable is publicly editable, it has no tooltip, which may confuse some users. To remedy this, enter a description in the variable's Tooltip property. Once this is done, the eye-shaped button will appear green.
It is important for beginners to note that you will not always want your variables to be public. Sometimes, giving a user the ability to easily change a critical variable can end up breaking or potentially altering important functionality. Always make sure that your public variables are things that an artist or level designer will need access to, and leave anything they are not supposed to touch as private.
You should always make sure your public variables have tooltips to explain what they are used for.