How to tell when local avoidance stopped but not end of path?

This is using the beta and FollowerEntity. It’s great that the agents stop when using local avoidance, eg:

Automatically stops when trying to reach a crowded destination when using local avoidance.

Is there something built in to detect that stopped state? The agent is stopped due to crowding, but has not reached destination or end of path. It will continue moving when the crowding is gone.

For example, say I have an enemy that can both do range and melee, but has preference to get in range and melee. A bunch of them rush in, they crowd the target, some are close enough to melee, but the rest stop out of melee range (local avoidance made them stop) so they should do ranged.

Is there an event or some other state to check that indicates “local avoidance made them stop”?

Hi

Currently this is not exposed, but it should be. I’ll try to add this functionality as soon as possible.

1 Like

Also, how do you turn local avoidance on/off in code?

It doesn’t seem to be exposed anywhere, and is buried inside managedState?

For the beta can you in general expose as much as possible? I’d just make code changes but that’s a huge pain in the ass because you’ve moved this to a package.

Was this ever added? Especially to FollowerEntity?

I’m not sure if the property Aron mentioned before was exposed- I checked ManagedState but I didn’t see much there that specifically said if there was any local avoidance being applied. That said, I did see that desiredVelocityWithoutLocalAvoidance is public, and you could probably get the difference between that and desiredVelocity to get the velocity that local avoidance is adding.

That said, there’s a note on the the velocity without local avoidance in the documentation:

If you are not using local avoidance then this property will in almost all cases be identical to desiredVelocity plus some noise due to floating point math.

So you’d want to set a threshold to check if it’s “zero”.