How to make Zombie Move via script

I was watching the animator tutorials and it said on the animator component if you check off the tick on apply root motion it would be running without actually transforming. Now I have a zombie Character Pack that actually just moves on the spot without it actually transforming so I was juat wondering How would you script a Zombie like that. On the video it says to use a function called OnAnimatorMove(). I am learning still and i did have a Zombie Script that worked with the Animator animations but am still have trouble in getting it to transform with animation considering the animations are on the spot. Please really need help with this because I really want to use the mixamo Zombie Character Contest Pack because it is really well designed and it is just what i was looking for my zombie game.

P.S. Please help…

This forum is really funny and really annoying at the same time because I have posted twice now and not 1 person can help.

There is a simple reason for that: you didn’t include your script. We can’t help you if you don’t show us the script you want help with.

It’s not the script It’s to do with the animations they are just in place motions but if you want to take a look at the script here it is: Please keep in mind I am working from the book getting started with unity and the character goes through Idle then when sees player the walk animation but it just doesn’t transform meaning it just animates it one spot and I have tried the animations on other characters and it still does the same.

#pragma strict
public var walking : boolean = false;
public var anim : Animator;
public var currentBaseState : AnimatorStateInfo;
public var walkForwardState : int = Animator.StringToHash(“Base Layer.Locomotion”);
public var idleState : int = Animator.StringToHash(“Base Layer.idle”);

private var playerTransform : Transform;
private var hit : RaycastHit;

function Start ()
{
anim = GetComponent(Animator);
playerTransform = GameObject.FindWithTag(“Player”).transform;
}

function Update ()
{
currentBaseState = anim.GetCurrentAnimatorStateInfo(0);

var distance : float = Vector3.Distance(transform.position, playerTransform.position);
switch (currentBaseState.nameHash)
{
case idleState:
if (
(Physics.Raycast (Vector3(transform.position.x, transform.position.y+.5, transform.position.z), transform.forward, hit, 40) hit.collider.gameObject.tag == “Player”) || distance < 2.0f)
{
anim.SetBool(“walking”,true);
}
break;
case walkForwardState:
//hasAttacked = false;
transform.LookAt(playerTransform);
var zombies:GameObject [ ] = GameObject.FindGameObjectsWithTag(“zombie”);
for (var zombie : GameObject in zombies)
{
if (Vector3.Distance(transform.position, zombie.transform.position) < 8.0f) zombie.GetComponent(controlZombie).setWalking(true);
}
break;
//break;
default:
break;
}
transform.position.y = 0.0;
transform.rotation.x = 0.0;
transform.rotation.z = 0.0;

}
function setWalking(newWalkingValue: boolean)
{

anim.SetBool(“walking”, newWalkingValue);

}

P.s. I was reading a help file on this somthink about the curves but the animation that I’m using is with the zombie character contest pack and the animations don’t have fbx for them they only have the fbx characters and prefab characters and also they do have a locomotion controller but i do not want the zombie to be a player tho.

Then you need to start posting screen captures of your animations settings, etc. There could be any number of reasons this isn’t working. Start by checking to ensure it actually has forward root movement. If you are using an animation that has none or didn’t check the option, it will walk in place. Also, use the code tags when you show code. It’s much, much harder to read code that isn’t properly formatted.

Thanx for reply but I’m dealing with mixamo now considering it is there product. There is no root motion at all so ticking the apply root motion don’t work. I paid $150 for this product on the asset store and yet you can’t even edit the animation. I have downloaded two free motions that have work from mixamo. Thanx for your help but I thought maybe a script may have worked.

I’m not really sure about this, because I haven’t worked with Mixamo yet, but I think there is a button on the websiteof your animation, whis says “In Place”. You have to change this to off and download the animation again. Maybe this will work.