# Terrain Set Neighbors

[Miscellaneous](../index.md) / [Terrain](index.md) / **Terrain Set Neighbors**

## Description

Executes the Set Neighbors method on the Terrain component

## Parameters

| Name | Description |
| :--- | :---------- |
| Left |  |
| Top |  |
| Right |  |
| Bottom |  |

## 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
{
    [Title("Terrain Set Neighbors")]
    [Category("Miscellaneous/Terrain/Set Neighbors")]
    [Description("Executes the Set Neighbors method on the Terrain component")]
    
    [Image(typeof(IconTerrain), ColorTheme.Type.Lime)]
    
    [Parameter("Left")]
    [Parameter("Top")]
    [Parameter("Right")]
    [Parameter("Bottom")]
    
    [Serializable]
    public class GenInstructionTerrain_SetNeighbors_4 : Instruction
    {
        [SerializeField] private GetGameObject m_Terrain = new GetGameObject(
            new GenTypeGameObject_Terrain()
        );
        
        [SerializeField] private GetGameObject m_Left = new GetGameObject();
        
        [SerializeField] private GetGameObject m_Top = new GetGameObject();
        
        [SerializeField] private GetGameObject m_Right = new GetGameObject();
        
        [SerializeField] private GetGameObject m_Bottom = new GetGameObject();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Neighbors");
            return $"{this.m_Terrain} {method} ({this.m_Left}, {this.m_Top}, {this.m_Right}, {this.m_Bottom})";
        }
        
        protected override Awaitable Run(Args args)
        {
            Terrain component = this.m_Terrain.Get<Terrain>(args);
            if (component == null) return Done;
            
            component.SetNeighbors(
                (Terrain) this.m_Left.Get<Terrain>(args),
                (Terrain) this.m_Top.Get<Terrain>(args),
                (Terrain) this.m_Right.Get<Terrain>(args),
                (Terrain) this.m_Bottom.Get<Terrain>(args)
            );
            
            return Done;
        }
    }
}


```

