Mecanim Making an NPC walk

What I have is a character mover script for an NPC that just moves the character around randomly. The problem is that I want it to not slide around. I would like to use Mecanim to handle the characters animations.

Is there a way to do this. I tried writing a vector3 script but it kept throwing errors and acting like it did not know what I was talking about.

Mostly, I want mecanim to kick in when the character moves, but velocity also is throwing errors. (I do my scripts in C#.)

Any ideas?

I figured it out. I hope this helps others.

In the Animator part of mechanim I had IsWalking and IsIdle bools backwards. The arrow going to walking should have been IsWalking True and the arrow going away from Walking should have been IsWalking false.

I really hope this helps others. It’s been confusing me for a while. I thought it was my script instead it was incorrect Bools.