---
title: "Instantiate"
content_type: tutorial
url: "https://learn.unity.com/course/beginner-scripting/tutorial/instantiate?language=en"
language: en
container_type: course
container_title: "Beginner Scripting"
container_url: "https://learn.unity.com/course/beginner-scripting.md?language=en&version=2021.3"
standalone_markdown_url: "https://learn.unity.com/tutorial/instantiate.md?language=en&version=2021.3"
previous_title: "Classes"
previous_url: "https://learn.unity.com/course/beginner-scripting/tutorial/classes-5?language=en&version=2021.3"
previous_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/classes-5.md?language=en&version=2021.3"
next_title: "Arrays"
next_url: "https://learn.unity.com/course/beginner-scripting/tutorial/arrays-9o?language=en&version=2021.3"
next_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/arrays-9o.md?language=en&version=2021.3"
difficulty: beginner
duration_minutes: 5
unity_version:
  - "2021.3"
supported_unity_versions:
  - name: "2021.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/instantiate.md?language=en&version=2021.3"
last_updated: "2026-10-07T22:10:49.000Z"
---

# Instantiate

Learn to use Instantiate to clone prefabs at runtime as part of the Beginner Scripting project.

How to use Instantiate to create clones of a Prefab during runtime.

Previous: [Classes](https://learn.unity.com/tutorial/classes-5?projectId=5c8920b4edbc2a113b6bc26a)

Next: [Arrays](https://learn.unity.com/tutorial/arrays-9o?projectId=5c8920b4edbc2a113b6bc26a)

## 1. Instantiate

[Video](https://connect-mediagw.unity.com/h1/20220104/videos/5bb22943-c73f-459b-81ce-0d9ffadbfeab_U_Beginner_22_Instantiate.mp4)

## **UsingInstantiate**

```csharp
using UnityEngine;
using System.Collections;

public class UsingInstantiate : MonoBehaviour
{
    public Rigidbody rocketPrefab;
    public Transform barrelEnd;
    
    
    void Update ()
    {
        if(Input.GetButtonDown("Fire1"))
        {
            Rigidbody rocketInstance;
            rocketInstance = Instantiate(rocketPrefab, barrelEnd.position, barrelEnd.rotation) as Rigidbody;
            rocketInstance.AddForce(barrelEnd.forward * 5000);
        }
    }
}
```

## **RocketDestruction**

```csharp
using UnityEngine;
using System.Collections;

public class RocketDestruction : MonoBehaviour
{
    void Start()
    {
        Destroy (gameObject, 1.5f);
    }
}
```
