I need help to fix character spinning around or stuck in place

Hi All,
I’m using A* Pro Beta 4.1.1, Unity 5.6.1f1.
I need help to fix my character, it’s spins around when getting to the target. Or sometimes it just get stuck in place and doesn’t move forward or behave like a rubber band, move forward and is just pushed back to original position.
I’ve setup my game as per example 6 Navmesh RichAI. I basically copied and paste most of the settings from there and made a few changes.
This is the TargetMover that I changed as I don’t need the other parts:

public class TargetMover : MonoBehaviour {
		/** Mask for the raycast placement */
		public LayerMask mask;

		public Transform target;
		RichAI[] ais;

        Camera cam;

		public void Start () {
			//Cache the Main Camera
			cam = Camera.main;
			ais = FindObjectsOfType<RichAI>();

			useGUILayout = false;

		// Update is called once per frame
		void Update () {
			if (Input.GetMouseButtonDown(0))

		public void UpdateTargetPosition () {
			Vector3 newPosition = Vector3.zero;
			bool positionFound = false;

				//Fire a ray through the scene at the mouse position and place the target where it hits
				RaycastHit hit;
				if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity, mask)) {
					newPosition = hit.point;
					positionFound = true;

			if (positionFound && newPosition != target.position) {
				target.position = newPosition;

					if (ais != null) {
						for (int i = 0; i < ais.Length; i++) {
							if (ais[i] != null) ais[i].UpdatePath();


I’ve attached pictures of the settings. I don’t have any script attached to the player or to the camera, that would trigger such behavior.

Here is a video where the weird behavior is shown.

Also, is there a way to make the rotation a bit smoother and not abrupt like in the video?

Please, help me to get this fixed as it’s a stopper on be able to make my game.

Thanks in advance…

I figure out that the Gravity is kinda required for the RichAI work fine as if the gravity is none and the character(shark) is away from the ground it goes crazy because it can’t reach the target on the ground/terrain where the click(position) happened.
Turning gravity on the RichAI fix some of the issues as the shark goes down to the position, but if the target is far away from the ground, like the whale shark is about Y=1.1 from the ground, the shark will spin around underneath it the whale shark, as it’s at y=0 and doesn’t move up.


Yes. Gravity is required for the RichAI component, at least if you are using a CharacterController to move it.
Note that this package does not support full 3D pathfinding (well, using a point graph it technically does, but usually it is a bad idea anyway). It looks like you are trying to use it for full 3D pathfinding?

Hi Aron,
yes, I was trying to use it for full 3D pathfinding and as you said and I figured out it will hard to make it work. I searched a lot for answers and ways to do it and I can’t believe how hard it’s to get information to do something that’s no FPS or TPS style.
I won’t be able to the pathfinding on this project and I’ll have to change the controller from click to move to a TPS style for the player and see how I’ll do AI without any pathfinding framework(navmesh, etc) as none that I found supports underwater.

Thanks a lot for your answer!