enemy AI problem.

I have a problem. for some reason, my enemy keeps on stoping and getting stuck in one place. here is what it looks like:

here is my script:

var target : Transform;
var damp = 5.0;
var speed = 3.0;

function Start () {
	// Auto setup player as target through tags
	if (target == null  GameObject.FindWithTag("Player"))
		target = GameObject.FindWithTag("Player").transform;
}

function Update () {
	if (target  Vector3.Distance(transform.position, target.position) < 30) {
		var rotate = Quaternion.LookRotation(Vector3(target.position.x, transform.position.y, target.position.z) - transform.position);
		transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.deltaTime * damp);
		
		var controller : CharacterController = GetComponent(CharacterController);
		
		var forward : Vector3 = transform.TransformDirection(Vector3.forward);
		controller.SimpleMove(forward * speed);
		
		Debug.Log("I'm Attacking!!!");
	}
	
	else if (target  Vector3.Distance(transform.position, target.position) > 30) {
		Debug.Log("I'm not Attacking!!!");
	}
}

PS, the reason the snowman disappears at the end is because I shot him, and it gets rid of his last life.

I think part of the problem is the snowman has problems with going down steep hills

Are you using a character motor component on the snowman?

It has a character controller, rigidbody, and an enemy health script, as well as the AI script

Hmm, I would try tweaking the slope limit var of the CC then… otherwise I’m not sure; if he had a character motor, I would say it had something to do with the slope speed multiplier.

that seemed to work, thanks!!