Answer the question
In order to leave comments, you need to log in
Is it possible to get paths from NavMesh?
I have several static objects, other objects move between them, since there are obstacles between them, NavMesh is used to find the path, something like this (2D)
MeshAgentPath = new NavMeshPath();
NavMesh.CalculatePath(TargetA.transform.position, TargetB.transform.position, NavMesh.AllAreas, MeshAgentPath);
if(MeshAgentPath.status == NavMeshPathStatus.PathComplete){
TargetCell = TargetB;
MeshAgent = GetComponent<NavMeshAgent>();
MeshAgent.updateRotation = false;
MeshAgent.updateUpAxis = false;
MeshAgent.SetDestination(TargetCell.transform.position);
}
...............
void Update(){
if(Vector3.Distance(transform.position, TargetCell.transform.position) > 0.5f){
.......
}else{........ // end way
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question