18 lines
319 B
C#
18 lines
319 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.AI;
|
||
|
|
||
|
public class Ai : MonoBehaviour
|
||
|
{
|
||
|
public NavMeshAgent agent;
|
||
|
public Transform target;
|
||
|
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
agent.SetDestination(target.position);
|
||
|
}
|
||
|
}
|