NavMesh.SamplePosition
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class NveAI : MonoBehaviour
{
NavMeshAgent nav;
// Start is called before the first frame update
void Start()
{
nav = transform.GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update()
{
}
public bool IsWithinRegion(Vector3 _ve)
{
NavMeshHit _hit;
bool _isAdd = NavMesh.SamplePosition(_ve, out _hit, 1, NavMesh.AllAreas);
return _isAdd;
}
}