Day 5 | A Simple Intro to Unity Variables

What Are Variables?

Basic Variable Types

Variable Accessibility Keywords

Variable Attributes

[SerializeField]
private int demoValue;
[HideInInspector]
public int demoValue;

A Quick Example

  • Accessibility Keyword: private/public
  • Variable Type: float, int, bool, string, etc.
  • Variable Name
  • (Optional) A value to assign the variable

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store