---
title: "Variables"
content_type: tutorial
url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables?language=en"
language: en
container_type: course
container_title: "C# Survival Guide - Variables"
container_url: "https://learn.unity.com/course/c-survival-guide-variables.md?language=en"
standalone_markdown_url: "https://learn.unity.com/tutorial/variables.md?language=en"
previous_title: "Script Overview"
previous_url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/script-overview?language=en"
previous_markdown_url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/script-overview.md?language=en"
next_title: "Common Data Types"
next_url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/common-data-types?language=en"
next_markdown_url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/common-data-types.md?language=en"
difficulty: beginner
duration_minutes: 10
unity_version:
  - "2019.3"
  - "2019.2"
  - "2019.1"
  - "2018.4"
  - "2018.3"
  - "2018.2"
  - "2018.1"
  - "2017.4"
  - "2017.3"
  - "2017.2"
  - "2017.1"
supported_unity_versions:
  - name: "2019.3"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2019.1"
  - name: "2018.4"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2018.4"
  - name: "2018.3"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2018.3"
  - name: "2018.2"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2018.2"
  - name: "2018.1"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2018.1"
  - name: "2017.4"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2017.4"
  - name: "2017.3"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2017.3"
  - name: "2017.2"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2017.2"
  - name: "2017.1"
    url: "https://learn.unity.com/course/c-survival-guide-variables/tutorial/variables.md?language=en&version=2017.1"
last_updated: "2026-08-04T14:22:40.000Z"
---

# Variables

Learn what variables are, how public and private variables differ, core data types, and how to debug values to the console.

In this tutorial, you will learn about variables. You will explore:

- What variables are and how they can be used
- The difference between public and private variables
- Basic data types such as int and string
- How to debug to console

## 1. Variables

[Video](https://connect-mediagw.unity.com/h1/20190524/videos/8b1edbf5-5036-4883-805e-aa68021ee311_01_Variables.mp4) ([Transcript (en)](https://connect-mediagw.unity.com/h1/20200205/2be13066-e57f-45f5-b80f-523006de168b_14_Variables.vtt))
