Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created March 9, 2024 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unitycoder/8e6e27faca3d40abf50c0842a51af558 to your computer and use it in GitHub Desktop.
Save unitycoder/8e6e27faca3d40abf50c0842a51af558 to your computer and use it in GitHub Desktop.
NavMesh Agent sample
using UnityEngine;
using UnityEngine.AI;
public class TestAgent : MonoBehaviour
{
public Transform target;
NavMeshAgent agent;
void Start()
{
agent = GetComponent<NavMeshAgent>();
agent.SetDestination(target.position);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment