- Home /
Question by
Miso-c9 · Apr 23, 2018 at 01:39 PM ·
navmeshnavmeshagentpathdestination
How to check if my player agent is at the end of the position
I just dont get that message in console, there is no errors.
void checkPosiiton()
{
if(Input.GetMouseButtonDown(0))
{
NavMeshPath path=new NavMeshPath();
agent.CalculatePath (agent.destination, path);
if (path.status == NavMeshPathStatus.PathComplete)
{
print ("I am Here");
}
}
Comment
"There is no errors" doesn't mean your code is doing anything worthwhile. You should view some guides on the Nav$$anonymous$$esh system before asking here. This forum is intended to be a resource once existing resources have been exhausted and your problem still exists. Here, it looks fairly clear from your code that very little information has been utilized so far.
Answer by tormentoarmagedoom · Apr 23, 2018 at 01:57 PM
Good day.
I normally check if the Vector3.Distance between destination.position and transform.position is lower than a value, inside a if sentence.
Bye!
If helped, accept the answer and close the question!