Hey everybody
Have anybody tried to make a Diablo style point and click controller using the NavMeshAgent for pathfinding ?? im trying to make one and got some problems with adding some animation to my character.
im using mecanim Animator
Best Regards
Pierre Skinnerup
How are you adding the animation? It doesn’t need to have anything to do with what kind of controller you’re using for motion.
Without knowing more there’s not a lot we can do to help you.
In case it is of use to you, in one of my projects I’ve completely decoupled animation from the movement and physics and have them in seperate components. The physics and movement component does its thing however it wants. The animation component caches the current and previous position and orientation, and applies an appropriate animation depending on how they’re changing.
Here is what i got so far
the problem i have is that when it reached its destination it begins to jitter between idle and run animation 
#pragma strict
var minionMeshAgent : NavMeshAgent;
var anim : Animator;
private var animSpeed = 1;
private var h : float;
private var a : boolean;
private var targetPosition : Vector3;
var playerTransform : Transform;
var isLocked = false;
function Start () {
targetPosition = this.transform.position;
}
function Update () {
if(Input.GetKey(KeyCode.Mouse1)) {
var playerPlane = new Plane(Vector3.up, transform.position);
var playerRay = Camera.main.ScreenPointToRay (Input.mousePosition);
var hitdist : float;
if (playerPlane.Raycast (playerRay, hitdist)) {
var targetPoint = playerRay.GetPoint(hitdist);
targetPosition = playerRay.GetPoint(hitdist);
isLocked = false;
}
}
if(Input.GetKey(KeyCode.Mouse0)) {
var enemyRay = Camera.main.ScreenPointToRay (Input.mousePosition);
var enemyHit : RaycastHit;
if(Physics.Raycast(enemyRay, enemyHit, Mathf.Infinity)) {
if(enemyHit.collider.gameObject.tag == "Enemy") {
targetPosition = enemyHit.point;
isLocked = true;
}
}
}
minionMeshAgent.destination = targetPosition;
CheckAnimation();
}
function CheckAnimation () {
var dist = Vector3.Distance(targetPosition, playerTransform.position);
if(minionMeshAgent.hasPath == false) {
h = 0.0;
}
else if(minionMeshAgent.hasPath == true) {
h = 1.0;
}
print(minionMeshAgent.hasPath);
anim.SetFloat("Speed", h);
anim.speed = animSpeed;
}
function Attacking ()
{
var enemyDist = Vector3.Distance(targetPosition, playerTransform.position);
if(isLocked == true) {
if(enemyDist <= 0.23) {
a = true;
}
else
{
a = false;
}
}
anim.SetBool("isAttacking", a);
}
a little bump 
still working on solving this is there a way to check if the Position i get from the ray are reachable with the navmesh ?
Best Regards
Pierre