---
title: "Activating GameObjects"
content_type: tutorial
url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects?language=en"
language: en
container_type: course
container_title: "Beginner Scripting"
container_url: "https://learn.unity.com/course/beginner-scripting.md?language=en&version=2019.3"
standalone_markdown_url: "https://learn.unity.com/tutorial/activating-gameobjects.md?language=en&version=2019.3"
previous_title: "Enabling and Disabling Components"
previous_url: "https://learn.unity.com/course/beginner-scripting/tutorial/enabling-and-disabling-components?language=en&version=2019.3"
previous_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/enabling-and-disabling-components.md?language=en&version=2019.3"
next_title: "Translate and Rotate"
next_url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate?language=en&version=2019.3"
next_markdown_url: "https://learn.unity.com/course/beginner-scripting/tutorial/translate-and-rotate.md?language=en&version=2019.3"
difficulty: beginner
duration_minutes: 5
unity_version:
  - "2019.3"
  - "2019.2"
  - "2019.1"
  - "2018.4"
  - "2018.3"
  - "2018.2"
  - "2018.1"
  - "2017.4"
  - "2017.3"
  - "2017.2"
  - "2017.1"
  - "5.x"
  - "4.x"
supported_unity_versions:
  - name: "2019.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2019.3"
  - name: "2019.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2019.2"
  - name: "2019.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2019.1"
  - name: "2018.4"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2018.4"
  - name: "2018.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2018.3"
  - name: "2018.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2018.2"
  - name: "2018.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2018.1"
  - name: "2017.4"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2017.4"
  - name: "2017.3"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2017.3"
  - name: "2017.2"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2017.2"
  - name: "2017.1"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=2017.1"
  - name: "5.x"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=5.x"
  - name: "4.x"
    url: "https://learn.unity.com/course/beginner-scripting/tutorial/activating-gameobjects.md?language=en&version=4.x"
last_updated: "2026-08-04T14:23:32.000Z"
---

# Activating GameObjects

Learn to control the active status of GameObjects in a scene and hierarchy using SetActive, activeSelf, and activeInHierarchy.

How to handle the active status of GameObjects in the scene, both independently and within Hierarchies, using SetActive and activeSelf / activeInHierarchy.

This tutorial is included in the [Beginner Scripting project](https://learn.unity.com/project/beginner-gameplay-scripting).

Previous: [Enabling and Disabling GameObjects](https://learn.unity.com/tutorial/enabling-and-disabling-components?projectId=5c8920b4edbc2a113b6bc26a)

Next: [Translate and Rotate](https://learn.unity.com/tutorial/translate-and-rotate?projectId=5c8920b4edbc2a113b6bc26a)

## Activating GameObjects

[Video](https://connect-mediagw.unity.com/h1/20220104/videos/9e240290-c4ef-45c9-aff1-f2e7e169fb77_U_Beginner_11_ActivatingGameObjects.mp4)

## **ActiveObjects**

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

public class ActiveObjects : MonoBehaviour
{
    void Start ()
    {
        gameObject.SetActive(false);
    }
}
```

## **CheckState**

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

public class CheckState : MonoBehaviour
{
    public GameObject myObject;
    
    
    void Start ()
    {
        Debug.Log("Active Self: " + myObject.activeSelf);
        Debug.Log("Active in Hierarchy" + myObject.activeInHierarchy);
    }
}
```
