Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Nav Mesh Agent Get Area Cost#

Navigation / Nav Mesh Agent / Nav Mesh Agent Get Area Cost

  • Can Read

  • Cannot Write

Description#

Returns the execution of Get Area Cost method on the Nav Mesh Agent component

Code#

// <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]

    [Title("Nav Mesh Agent Get Area Cost")]
    [Category("Navigation/Nav Mesh Agent/Get Area Cost")]
    [Description("Returns the execution of Get Area Cost method on the Nav Mesh Agent component")]

    [Image(typeof(IconNavmeshAgent), ColorTheme.Type.Red)]
    [Keywords("Navigation, NavMesh, AI, Pathfinding, Agent")]

    [Serializable]
    public class GenTypeNumber_NavMeshAgent_GetAreaCost_1 : TypeNumber
    {
        [SerializeField] private GetGameObject m_NavMeshAgent = new GetGameObject(
            new GenTypeGameObject_NavMeshAgent()
        );

        [SerializeField] private GetInteger m_AreaIndex = new GetInteger();

        public override double Get(Args args)
        {
            NavMeshAgent component = this.m_NavMeshAgent.Get<NavMeshAgent>(args);
            if (component == null) return default;

            double value = (double) component.GetAreaCost(
                (int) this.m_AreaIndex.Get(args)
            );

            return value;
        }

        public override string ToString()
        {
            return $"{this.m_NavMeshAgent} Get Area Cost ({this.m_AreaIndex})";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.