adjective · apt or liable to vary or change; changeable:[var·i·a·ble]

John Nix
2 min readMay 14, 2021

one of the most important things when writing a scrip it this little aspect that can consist of many data types here are four of the most common data types used the most. A int, float, Boolean, and last but not least the Stings as well there is presets to immanent such as Private, and public. if you set a variable with out a preset it is by default set to public. and public leaves the variable open, meaning that it is able to be altered and changed by any other aspect of any script in the project which can reek havoc on a build and is recommended not to leave public unless necessary. in his case I recommend sin [SerializeField], as in the reference blow.

now in the reference there is several things missing that should be in the scripting which I will touch on in follow up postings such as, (Titles to look for, “So you know- “PSEUDO””), witch will layout the why and how to write the Pseudo code in a script which will look something like, ( // This is to get the player to move left and right using the A, and D key on the key board).

now back to topic at hand, with the variables lets break it down and first you have the data types.

1) an int, what is an int? an int is = to a whole number no decimal numbers.

EXAMPLE: [SerializeField]
private int _lives = 3; the serializeField allows the private to be seen and altered in the inspector.

2) a float is = to a mixed number, numerical. this is a number with a decimal such as 1.0f just as so.

EXAMPLE: [SerializeField]
private float _fireRate = .05f;

3) what is a Boolean? a Boolean or bool for short is a true / false statement or switch check box turning a function off or on.

EXAMPLE: private bool _isTripleShotActive = false; with out the serializedField it can only be adjusted by the scripting and will not be seen in the inspector.

4) What is a string? a String is a string of text such as a name or even a list of names as in an array. (Which we will get to in a latter post.)

EXSAMPLE: [SerializeField]
private GameObject _tripleshotPrefab; in this one it will have a slot in the inspector for you to place the named item in the inspector to link to the variable.

--

--