[Solved] Use A* with Root Motion and RigidBody

It worked great when only Root Motion and A * were used together.

Adding Rigidbody to this is a problem.

As you move, keep moving and keep moving forward.

How can I solve this problem?


Hey, are you using the MecanimBridge?

Yes. I’m using Unity’s Mechanic State Machine.

I meant are you using the MecanimBridge script provided with A*.
That will handle root motion being implemented into the movement system

No. Just use Seeker, AI Path, 2 components.

I’d recommend looking at the MecanimBridge it’s should pretty much work out of the box. Place the script on the same object as the animator and movement script.

You might have to change the animator strings depending on your animator settings

This was fixed by modifying the contents of “FinalizeRotation” in “AIBase.cs”.

if (updateRotation)
if (rigid! = null)
transform.rotation = nextRotation; <-Modified code
//rigid.MoveRotation(nextRotation); <-Original code
else if (rigid2D! = null) rigid2D.MoveRotation (nextRotation.eulerAngles.z);
else tr.rotation = nextRotation;