RichAI validation goes off if path isn't assigned

On my project I’ve encountered a pretty weird bug:

  1. RichAI agent is running along the wall
  2. By game logic AI should stop and look at player which is on the other side of the wall:
richAI.SetPath(null);
transform.rotation = GetLookRotation(target); 
  1. Agent rotates, but because of low RichAI.Acceleration param the AI doesn’t stop immediately, and goes into wall - falling of the map

I have both RichAI.UpdatePosition and UpdateRotation set to True

Also I tried to call
richAI.Rotation = GetLookRotation(target);
but it’s completly the same thing with UpdateRotation turned on

Maybe it’s because I disable EnableRotation, but it will prevent me to rotate agent freely in the direction I need

On the video below AI rotates towards me when it gets debug damage. Accelaration is 0.5 just for example, in actual game it’s higher and there is more chance that agent stops somewhere between graph wall and actual wall

Hi

This is expected. The RichAI uses the path info to determine where it is on the navmesh. If that is cleared, then the agent no longer has any idea of where on the navmesh it is, and cannot clamp itself to it.
If you want to stop the agent, I would recommend that you set ai.isStopped = true instead. That will let the agent keep its path.

Thanks, that works just as intended

For me this feature was hidden too much inside documentation

1 Like