Hello !
I fail to configure Recast agent parameters.
I start from this playground.
1) How to stop agent faster ?
Agents take too much time to stop, I call this the sliding effect. I even had cases where 4 agents would start endlessly circling around the target point. At first, I thought to use separationWeight
, but it does not resolve the problem. I still experience small tremors at best and really bad positioning at worse.
UPDATE : I was using ICrowd
interface, not RecastJSCrowd
! With the latest we have onReachTargetObservable
and we can use that to immediately stop the agent, as show in this playground. Sadly this technique only works for one agent : when we select 10 units, only one unit will reach the target position, unless to increase the target radius (don’t even know if possible) but this would affect final positioning for sure.
UPDATE 2 : I think we can play with velocity to detect slow movement and use teleport to stop the agent, it brings new problems but it could do the job. I will update the PG later.
Also, when using Typescript, we cannot use RecastJSCrowd
as it brings type incompatibility (on Vector3 for example), the workaround is to cast only when needed.
2) How to reduce agent pushing effect ?
One agent can push other without problem, how to reduce this effect ?
(we cannot see that on the playground sorry because I didn’t updated it enough)
UPDATE : Question already posted but without solution
3) How to ensure same agent speed ?
The playground above shows that agents do not always move with the same speed while they have the same configuration. This effect is exacerbated when we increase collisionQueryRange
. Getting some difference is logical, but sometimes it is not.
UPDATE: setting a huge value for acceleration can do the trick.
I read some parts of the official documentation but found nothing.