Variables & Types

Variables are named containers for the values your game tracks, and every one has a type that decides what it can hold: an int for a score, a float for speed, a bool for whether the player is grounded, a string for a name. Unity scripts are built out of these, and the type you choose shapes how a value behaves in code and how it shows up in the Inspector.

More in C# Foundations

  1. Variables & Types
  2. Control Flow & Loops
  3. Methods & Classes
  4. Collections
  5. Interfaces & Inheritance
  6. Delegates & Events

All 42 topics in the Learn Unity Roadmap