Click Move Animation mecanim?

Hi guys
i was create Click-Move Mecanim on Unity.
But, i want, if my charchter’s position on target position,he idle,
he on the way, Run animation play …etc…
somebody help me for c# code?

(i tried this code but it not run )

void Update ()
{
mes = Vector3.Distance(TargetPosition, transform.position);
if (mes>=5f)
{

anim.SetBool(“Hareket_g”, true);

}

if( mes<=5f)
{
anim.SetBool(“Hareket_g”, false)
}

;

Hi,

You could also feed the characters speed into mecanim and use it to decide what animations to play,
similar to Unity - Manual: Blend Trees