O'Reilly logo
  • Joseph Simpson thinks this is interesting:

using UnityEngine; using System.Collections; public class FollowDestination : MonoBehaviour { private NavMeshAgent ThisAgent = null; public Transform Destination = null; // Use this for initialization void Awake () { ThisAgent = GetComponent<NavMeshAgent>(); } // Update is called once per frame void Update () { ThisAgent.SetDestination(Destination.position); } }

From

Cover of Unity 5.x By Example

Note

Need to include using UnityEngine.AI;