using System.Collections; using System.Collections.Generic; using UnityEngine; public class NavTest : MonoBehaviour { public Transform targetpos; private UnityEngine.AI.NavMeshAgent nav; void Start() { nav = GetComponent(); nav.SetDestination(targetpos.position); } // Update is called once per frame void Update() { } }