Nav Mesh Agent Move#
Navigation / Nav Mesh Agent / Nav Mesh Agent Move
Description#
Executes the Move method on the Nav Mesh Agent component
Parameters#
| Name | Description |
|---|---|
| Offset |
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
{
[Title("Nav Mesh Agent Move")]
[Category("Navigation/Nav Mesh Agent/Move")]
[Description("Executes the Move method on the Nav Mesh Agent component")]
[Image(typeof(IconNavmeshAgent), ColorTheme.Type.Red)]
[Keywords("Navigation, NavMesh, AI, Pathfinding, Agent")]
[Parameter("Offset")]
[Serializable]
public class GenInstructionNavMeshAgent_Move_1 : Instruction
{
[SerializeField] private GetGameObject m_NavMeshAgent = new GetGameObject(
new GenTypeGameObject_NavMeshAgent()
);
[SerializeField] private GetVector3 m_Offset = new GetVector3();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Move");
return $"{this.m_NavMeshAgent} {method} ({this.m_Offset})";
}
protected override Awaitable Run(Args args)
{
NavMeshAgent component = this.m_NavMeshAgent.Get<NavMeshAgent>(args);
if (component == null) return Done;
component.Move(
(Vector3) this.m_Offset.Get(args)
);
return Done;
}
}
}