# Terrain Grouping ID

[Miscellaneous](../index.md) / [Terrain](index.md) / **Terrain Grouping ID**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :green_circle: Can Write

</div>

## Description

The Grouping ID property of the Terrain component

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    [Set]

    [Title("Terrain Grouping ID")]
    [Category("Miscellaneous/Terrain/Grouping ID")]
    [Description("The Grouping ID property of the Terrain component")]

    [Image(typeof(IconTerrain), ColorTheme.Type.Lime)]

    [Serializable]
    public class GenTypeInteger_Terrain_GroupingID : TypeNumber
    {
        [SerializeField] private GetGameObject m_Terrain = new GetGameObject(
            new GenTypeGameObject_Terrain()
        );

        public override double GetPreview(GameObject source)
        {
            GameObject instance = this.m_Terrain.GetPreview(source);
            if (instance == null) return default;

            Terrain component = instance.GetComponent<Terrain>();
            return component != null ? component.groupingID : default;
        }

        public override double Get(Args args)
        {
            Terrain instance = this.m_Terrain.Get<Terrain>(args);
            return instance != null
                ? instance.groupingID
                : default;
        }

        public override void Set(double value, Args args)
        {
            Terrain component = this.m_Terrain.Get<Terrain>(args);
            if (component != null) component.groupingID = (int) value;
        }

        public override string ToString()
        {
            return $"{this.m_Terrain} Grouping ID";
        }

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

