using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
[RequireComponent(typeof(NavMeahAgent))]
public class HimikoFollow : MonoBehaviour
{ }
public float distanciaMinima = 2;
public Transform alvo;
private NavMeshAgente navMeshAgente;
// Start is called before the first frame update
void Start()
{
navMeshAgent = GetComponent();
}
// Update is called once per frame
void Update()
{
if (Vector3.Distance(transform.position, alvo.position) <= distanciaMinima) return;
navMeshAgent.SetDestination(alvo.position);
{ }