Files
grow-ai-unity/Assets/Scripts/PersonMovement.cs
j.mei7 7e0f3e6930 init
2022-03-01 20:47:08 +01:00

22 lines
436 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class PersonMovement : MonoBehaviour
{
NavMeshAgent agent;
private void Awake()
{
agent = GetComponent<NavMeshAgent>();
agent.updateRotation = false;
agent.updateUpAxis = false;
}
public void SetTarget(Transform target)
{
agent.SetDestination(target.position);
}
}