---
tags:
    - "Loaded"
    - "Belongs"
    - "Owner"
    - "Level"
    - "Where"
---

# Game Object Scene

[Game Object](index.md) / **Game Object Scene**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

The scene the specified Game Object belongs to

## Parameters

| Name | Description |
| :--- | :---------- |
| Game Object | The Game Object whose scene is returned |

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Game Object Scene")]
    [Category("Game Object/Game Object Scene")]

    [Description("The scene the specified Game Object belongs to")]
    [Image(typeof(IconUnity), ColorTheme.Type.Blue, typeof(BadgeCubeOutline))]

    [Parameter("Game Object", "The Game Object whose scene is returned")]

    [Keywords("Loaded", "Belongs", "Owner", "Level", "Where")]

    [Serializable]
    public class TypeSceneGameObject : TypeScene
    {
        [SerializeField] private GetGameObject m_GameObject = new GetGameObject();

        public override int Get(Args args)
        {
            GameObject gameObject = this.m_GameObject.Get(args);
            return gameObject != null ? gameObject.scene.buildIndex : -1;
        }

        public override string ToString()
        {
            return $"{this.m_GameObject} Scene";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

