Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: tcmeric on April 30, 2017, 12:06:51 PM

Title: Calculate Navmesh Agent Path Target Destination by Corners
Post by: tcmeric on April 30, 2017, 12:06:51 PM
Unitys built in NavMeshAgent.remainingDistance can return the result of infinity (instead of the correct distance) when two or more corners (path points) have been calculated. This means the playmaker action "Get Agent Remaining Distance" is not reliable in many cases (as it is using NavMeshAgent.remainingDistance).

An alternative method is calculating the corners (path points) distance instead. An example is given in the unity documentation. I used the documentation to create an action to do so.

https://github.com/dumbgamedev/general-playmaker/blob/master/path/calculateAgentDistanceByCorners.cs

Ive tested it out several times and it returns the same result as the action Get Agent Remaining Distance, except it never returns infinity (good!).

Maybe this action plus the path debug action I posted should be added to the playmaker navmesh package? (Might need name changes/ different category).
Title: Re: Calculate Navmesh Agent Path Target Destination by Corners
Post by: autumnboy on October 12, 2017, 01:53:48 AM
Awesome. Get Agent Remaining Distance was driving me crazy. Thanks for this! :)
Title: Re: Calculate Navmesh Agent Path Target Destination by Corners
Post by: jeanfabre on October 12, 2017, 04:04:29 AM
Hi,

 yes it should be added indeed :)

 Eric, do you feel like adding it to the github rep?

bye,

 Jean
Title: Re: Calculate Navmesh Agent Path Target Destination by Corners
Post by: Twood on June 01, 2021, 03:28:51 PM
Looks like it was never added to ecosystem? Would someone mind adding it?

edit: actually nevermind this also is not working right. I hate unity pathfinding, it's so hard to get into useful shape lol.