Variables! — The building blocks of programming’

As we talk about variables today, the use of variables even in everyday life applications is the way we tell our scripts what we want to do. It is basically a definition of a noun.

For Example: You want to create a game object to walk across the screen. You need a call sign for it. (For a lack of a better word. ) So you would write it like this.

public gameObject _BlueMan;

This is what a variable is used for. There are three other variables functions which are int, float, and bool The first and the second one, which I shared with you, are for numbers. The int is used for whole numbers. The float is for numbers with decimals and is accompanied by a standard letter f after the number. The bool is for true and false.

While all this works with either a public or private to tell Unity that either you can see it and others can access it or not. However, with the code [SerializeField] above it, this will allow unity to place an opening in the inspector window to tweak the number. This process will allow others who work on the game to tweak numbers to make the game smoother.

As I go along with the coding descriptions, I hope to show my understanding.

So have a great day and please feel free for feedback.