Estimating time to arrive at destination?

Hi,

I’m using RichAI with a Recast Graph. The agent is a humanoid character, and is not using Root Motion. I looked through the docs and couldn’t find anything. Are there any built in fields or functions to estimate the time until arrival at the destination? I want to use this information to sync with walk/run to stop transition animations.

Thanks!

Hi

There is no built-in option for estimating the remaining path, because that depends on factors outside the script’s control (e.g. another script might change the speed of the agent, push it around or do all kinds of things). However there is a method for getting the remaining distance. Then you can build an approximation based on that.

See
RichAI. remainingDistance: https://arongranberg.com/astar/docs/richai.html#remainingDistance
RichAI.GetRemainingPath: https://arongranberg.com/astar/docs/richai.html#GetRemainingPath

@aron_granberg What about for a GridGraph + AIPath?

If not could you give me some pointers on how to use remaining distance to calculate the est remaining time given the AIPath’s acceleration & deceleration values?

Thanks!

Hi

I have not made a very accurate analysis of this, but I think for animation purposes just using the estimated time from remainingDistance / maxSpeed will give you a decent enough approximation which you can use as a threshold.