Cute_demon_attacks/meng_yao/Assets/script/Ai.cs

18 lines
319 B
C#
Raw Normal View History

2024-12-09 11:56:41 +08:00
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);
}
}