Playmaker Forum

Playmaker Updates & Downloads => Share New Actions => Topic started by: tcmeric on April 30, 2017, 09:06:51 AM

Title: Calculate Navmesh Agent Path Target Destination by Corners
Post by: tcmeric on April 30, 2017, 09:06:51 AM
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 11, 2017, 10:53:48 PM
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, 01:04:29 AM
Hi,

 yes it should be added indeed :)

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

bye,

 Jean