---
tags:
    - "Navigation, NavMesh, AI, Carve, Block"
---

# Nav Mesh Obstacle

[Components](../index.md) / [Navigation](index.md) / **Nav Mesh Obstacle**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

A direct reference to a Nav Mesh Obstacle 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;
using UnityEngine.AI;

namespace VisualScript.Runtime
{
    [Get]

    [Inline(nameof(m_Value), typeof(NavMeshObstacle), true)]

    [Title("Nav Mesh Obstacle")]
    [Category("Components/Navigation/Nav Mesh Obstacle")]
    [Description("A direct reference to a Nav Mesh Obstacle component")]

    [Image(typeof(IconNavmeshObstacle), ColorTheme.Type.Red)]
    [Keywords("Navigation, NavMesh, AI, Carve, Block")]

    [Serializable]
    public class GenTypeGameObject_NavMeshObstacle : TypeGameObject
    {
        [SerializeField] private NavMeshObstacle m_Value;

        public override GameObject GetPreview(GameObject source)
        {{
            return this.m_Value != null
                ? this.m_Value.gameObject
                : null;
        }}

        public GenTypeGameObject_NavMeshObstacle()
        { }

        public GenTypeGameObject_NavMeshObstacle(NavMeshObstacle component)
        {
            this.m_Value = component;
        }

        public override GameObject Get(Args args)
        {
            return this.m_Value != null
                ? this.m_Value.gameObject
                : null;
        }

        public override U Get<U>(Args args)
        {
            if (typeof(U) == typeof(NavMeshObstacle))
            {
                return this.m_Value != null
                    ? this.m_Value as U
                    : null;
            }

            return base.Get<U>(args);
        }

        public override string ToString()
        {
            return TextUtils.Name(this.m_Value);
        }

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

