How do i implement animation?

I am trying to set up my characters with animation, but I dont know where to start. I would like to use the mecanim humanoid system, but the example bot uses legacy animation. Is this the preferred way to use animations with a* project?

I managed to set up a walk animation with the ‘get started’ AstarAI script, but it is unusable since my character does not turn towards the path. This was using mechanim, and I guess that animating and scripting the character to use the root transform rotation is going to be tricky but doable. But I am unfortunatly not that much of a programmer (but I am learning)…
Can i use or modefy richAI or AIpath, or should I write a new script?
I am using the recast graph on a procedural terrain.

How do you guys implement animation? Is there a best practice?
I would really appreciate it if you could at least point me in the right direction.

Hi

Yeah currently there is no example scene showing how to set it up using mecanim.
You can use pretty much the same approach as is done for the unity navigation system however. See https://docs.unity3d.com/Manual/nav-CouplingAnimationAndNavigation.html

1 Like

Did you find a solution? I have the same problem.

Hi Sami. Sorry for first replying now, you have properbly figured it out yourself by now. It has been a while, but it was fairly simple as I recall. I added a character controller, set the ‘Min Move Distance’ to 0.0001, and wrote a small script (I intended to expand upon) with something like this in the update function:

public CharacterController controller;
public Animator animator;
bool isMoving = false;

void Update () {

   if ( controller.velocity != Vector3.zero )
    {

        bool isMoving = true;

        animator.SetBool("isMoving", isMoving);

    }

   if (controller.velocity == Vector3.zero)
    {
        bool isMoving = false;

        animator.SetBool("isMoving", isMoving);

    }

}

This is a very powerful asset, but I think a ELI5 or some video tutorials in the documentation would be a huge help for noobs like me.