---
title: "Get started with scripts"
content_type: tutorial
url: "https://learn.unity.com/tutorial/get-started-with-scripts?language=en"
language: en
difficulty: foundational
duration_minutes: 30
unity_version:
  - "2021.3"
supported_unity_versions:
  - name: "2021.3"
    url: "https://learn.unity.com/tutorial/get-started-with-scripts.md?language=en&version=2021.3"
  - name: "2019.4"
    url: "https://learn.unity.com/tutorial/get-started-with-scripts.md?language=en&version=2019.4"
available_languages:
  - name: "en"
    url: "https://learn.unity.com/tutorial/get-started-with-scripts.md?language=en"
  - name: "es"
    url: "https://learn.unity.com/tutorial/como-comenzar-a-usar-scripts.md?language=es"
  - name: "ja"
    url: "https://learn.unity.com/tutorial/get-started-with-scripts-jp.md?language=ja"
  - name: "ko"
    url: "https://learn.unity.com/tutorial/seukeuribteu-sijaghagi.md?language=ko"
last_updated: "2026-08-04T14:22:48.000Z"
---

# Get started with scripts

Learn how code shapes Unity experiences, work with your IDE, and create or edit script components that output messages to the Console window.

In this tutorial, you’ll:

- Identify the role of code in creating experiences in Unity.
- Discover what IDEs are, and what IDE is installed on your system.
- Create a new script component.

## Materials

- [VIDEO TRANSCRIPT- Real-time content creation tools - Integrated development environments.pdf.zip](<https://unity-connect-prd.storage.googleapis.com/20201103/c9416f20-5a41-4f8e-a5a5-f6b0a110eaf0/VIDEO TRANSCRIPT- Real-time content creation tools - Integrated development environments.pdf.zip>)

## 1. Overview

In previous tutorials, you added components to GameObjects to change their properties and behaviors. In addition to using the components provided in the Unity Editor, you can customize the properties and behaviors of GameObjects by writing custom **scripts** in the C# language.

In this tutorial, you will create a simple “Hello World” component and add it to a GameObject. You will see how you can use scripts to manipulate what appears in the Inspector window for any GameObject. Along the way, you will learn about the tools and windows used for programming in Unity.

## 2. Integrated development environments (IDEs)

# What are IDEs?

Integrated Development Environments (IDEs), such as [Visual Studio](https://visualstudio.microsoft.com/) and [Rider](https://www.jetbrains.com/rider/), allow programmers to write and debug code as efficiently as possible. IDEs support programming in a wide range of languages (e.g. C#, Java, Javascript, Python, etc.); Unity development is typically done in C# (pronounced “see sharp”) using Visual Studio.

![](https://connect-mediagw.unity.com/h1/20201103/learn/images/47a8b4da-9f00-44e2-97da-10853a90fe0c_Foundations_UnityRT3D_1.2.5.1_visual_studio.png)

Watch the video below to hear how IDEs are used by some of our established creators.

[Video](https://connect-mediagw.unity.com/h1/20201103/videos/0ba35285-00d8-4d72-8e69-ddb133b2d963_Vid_2H_1.19_V2.mp4)

[Download Transcripts](https://connect-prd-cdn.unity.com/20201103/c9416f20-5a41-4f8e-a5a5-f6b0a110eaf0/VIDEO%20TRANSCRIPT-%20Real-time%20content%20creation%20tools%20-%20Integrated%20development%20environments.pdf.zip?_ga=2.161168756.877746306.1604337391-733260295.1595906103)

It is technically possible to write code in a simple text document, but IDEs provide developers with a suite of tools to make programming easier. For example, most IDEs include **error detection** to highlight when something is coded incorrectly, a **debugger** to help locate the source of an error, **syntax highlighting** to make the code easier to read, and **code completion** to instantly fill out lines of code.

![](https://connect-mediagw.unity.com/h1/20201103/learn/images/f82d7c16-e8fb-4d32-94c4-3f6cf3f0d87f_unnamed__2_.png)

Unity comes packaged with Visual Studio, and integrates with Visual Studio to make coding and debugging much easier than it would be in a completely separate IDE.

## 3. Install the IDE

Visual Studio is installed during the initial Unity installation, but if it is not on your machine you can use the steps below to install it. This tutorial is based on Visual Studio.

You can check if you have Visual Studio installed and set up as your default script editor by going to **Unity** > **Preferences** and selecting **External Tools**. If Visual Studio is installed, it will be in the drop down menu for the **External Script Editor**.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/a9796d2e-f5f4-40a5-a9f9-c1d0a2b86544_1.3_Install_the_IDE__1_.png)

Follow these steps to install Visual Studio if you need to do so.

**1.**  Open the Unity Hub and select the **Installs** section.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/daff11cb-421f-4daa-95b2-9a470dc4c589_1.3_Install_the_IDE__2_.png)

**2.**  Select the three dots on the top right of the Unity version you are using.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/e7cc364f-2881-4d64-83d6-9c7c6be8187e_1.3_Install_the_IDE__3_.png)

**3.**  Select **Add Modules**.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/94d5db95-9529-4555-b8c5-40fac0563d37_1.3_Install_the_IDE__4_.png)

**4.**  Select the checkbox for the **Microsoft Visual Studio** installation, and select **Next**.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/da0be518-0b56-44b6-93fd-5482e0c1aec3_1.3_Install_the_IDE__5_.png)

## 4. Create a new script

Let’s create your first script.

**1.**  Open the 3D project you created for **Challenge: The Floor is Lava!** You’ll have an opportunity to customize this project further with scripting.

**2.**  Create a new empty GameObject in the Scene by right-clicking in the Hierarchy and selecting **Create Empty**.

**3.**  Change the name of the new GameObject to ScriptObject using the Inspector window.

**4.**  While your new GameObject is still selected, select **Add Component** in the Inspector window. Select the **New Script** option.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/dbb03f42-24a6-47b6-a530-d314b0007b02_1.4_Create_a_new_script__1_.png)

**5.**  The typical first lesson in scripting in a new environment is the “Hello, World!” exercise, which is what we will do with this new script. Name the new script HelloWorld, and select the **Create and Add** button.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/61701b1e-bbf9-4632-8ecf-ada2db851aaa_1.4_Create_a_new_script__2_.png)

**6.**  The script is now added to the empty GameObject as a component, and it also now appears in your project’s **Assets** folder.

![](https://connect-mediagw.unity.com/h1/20221116/learn/images/bd96eca7-556c-4728-bd62-86728a642355_1.4_Create_a_new_script__3_.png)

**7.**  Double-click the new script to open it in Visual Studio.

## 5. Next Steps

You are ready to start coding your new script component, which is attached to an empty GameObject. Next, we will explain the default script that you see when you open Visual Studio.
