Hi,
i don't understand why the animation "d1" does not work, d1 is not animating, when i set the boolean "hasPushed" to "true", so that the animation does not repeat :
function Update () {
//...
/* push */
if ( (hasPushed==false) && (Vector3.Distance(playerToFollow.position, thisTransform.position) < (dist/3) ) ){
animation.CrossFade("d1");
playerToFollow.GetComponent(official).desD = true;
hasPushed = true;/* HERE : without it, it works fine but does not stop */
/* walk */
} else if ( Vector3.Distance(playerToFollow.position, thisTransform.position) < (dist/1.3) ){
animation.CrossFade("slow");
}
How could i stop the animation with something else than a boolean?
Thanks
↧