Skip to content

Instantly share code, notes, and snippets.

@baobao
Created January 20, 2017 07:21
Show Gist options
  • Save baobao/3ceffea30648d5bd9f40bd4debec7858 to your computer and use it in GitHub Desktop.
Save baobao/3ceffea30648d5bd9f40bd4debec7858 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class NavMeshPlayer : MonoBehaviour
{
public Transform goal;
void Start ()
{
NavMeshAgent agent = GetComponent<NavMeshAgent>();
agent.destination = goal.position;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment