Non kinematic rigidbody - AI Path / Rich AI

I am not sure if this is even supported so just looking for any feedback. I have no problems with kinematic rigidbody agents with AI Path and RichAI. I do have problems though when trying to use a non-kinematic rigidbody. Movement is not smooth, even with interpolation enabled. Agents stop pathfinding properly if anything moving touches them and other oddities.

This might be a dead thread but did you ever resolve this? I too am looking to use non kinematic rigidbodies and so far I cant tell if this is the right asset for that

I am working on a physics based fps. Astar pathfinding does not have this built in, but with a little work it can be achieved. There is a setting for the agents where you can tell Astar to never move anything. There are hooks so you can tell Astar when to process the movement and provide the results. I take these results and process my own movement by applying forces and torque. One of the challenges is dealing with things when they go off mesh. I have agents smashing into a lot of things and other objects that send them flying so it cannot be expected that they will always be on mesh. When agents go off mesh, I have them move towards the closest point on the mesh. I have a panic routine that checks how long agents are off mesh among other things. So if they get stuck or something odd then they self destruct. I use this same logic to warn the player when they are out of bounds and then destroys them if it takes too long to return. I actually use a separate “Bounds” mesh to check for on/off mesh. This mesh does not include any static/dynamic objects. So for example, an agent can get pushed onto a large rock and will be considered in bounds but otherwise the rock will be avoided in the normal path.

Thanks for the reply, that sounds similar to what I found. By default it seems to use rigidbody.moveposition and rigidbody.MoveRotation, which are supposed to only work on kinematic Rigidbodies, and as you found its very jittery.

I ended up using the results of AIPath.steeringTarget and AIPath.desiredVelocity to get an idea of where in space the pathfinding wants to turn and wants to go. Is that close to what you did when you said it provides results?

Good idea about the off mesh, I hadn’t even considered that. My AI just blows up if it “panics” but I’m a long way from done so it works.

First, I make sure that canMove on richAI is always disabled. Then I get the next position each physics update:

Vector3 nextPosition;
Quaternion nextRotation;
richAI.MovementUpdate(Time.fixedDeltaTime, out nextPosition, out nextRotation);

I only use nextPosition to then calculate everything needed. A rotation force and a forward force is applied based on the difference between agents current position and nextPosition. I did not end up using nextRotation as it did not fit into my off mesh calculations.

OK great thanks. Im on the free version so I dont get to mess around with the RichAI. Ill see if I can do the same with the regular AI

Hey real quick, you’ve been using this a year. think its worth the money? The free version leaves a lot out so its hard to get an idea if its worth it.

This is one of the few in game assets I use and do recommend. Other options would be to code your own from scratch or use the Unity path system. The built in Unity pathing just did not cut it for me when I played with it but that was some time ago. Besides all the features Astar provides, Aron is a top notch coder and keeps up with bug fixes and improvements. When I first started using, there were several changes I would need to make to Astar each time I updated. Some were bugs but others were just odd requirements I had. Now I don’t do a darn thing as everything was fixed and some extra requirements I had were implemented by Aron. As far as 3rd party pathfinding assets go, I don’t think there is anything that compares.