playMaker

Author Topic: NavMesh path reach end [SOLVED]  (Read 1437 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
NavMesh path reach end [SOLVED]
« on: July 27, 2016, 12:20:04 PM »
Hi guys,

this is my first attempt using navmesh, i learned a lot this few last days, but at some point it's not completly understandable.

the main point for now, is this:

i made a mob, wich is randomly changing his direction, and move to the point following the navmesh possibilities.
ok, it works, it move to the point, but how can i trigger the arrival of this point?

i'm wondering... i can maybe compare Vector3 X,Z from the mob to the vector 3 of his target position, but in this case, the value must be exactly the same.

isn't it a faster and easiest way to tell the nav mesh agent at end, follow next event ?

I fund a RemainingDistance Variable so i can Get this information and compare it To 0, but it's always at 0...
Should i set it with a manual calculation ?

Well, i also tested using Pathfinding Actions
Get Agent Remaining Distance Still locked at 0.

there is certainly something i didn't catched about it.
« Last Edit: July 27, 2016, 05:37:07 PM by blackant »

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: NavMesh path reach end [SOLVED]
« Reply #1 on: July 27, 2016, 05:39:53 PM »
ok, i finally fund, it was working but i think the way it calculs the distance can sometimes take longer than other actions so sometimes it will not have time to display any result and finally skip the calcul to jump directly to the next event.
and sometimes it has time to calculate... and it works.

so the best way is to separate the action to get the the distance and another action to take the time of travelling.