controller.simplemove having issues with vector3.forward

EDIT: See my comment response below this post

I am trying to simply move my enemy forward (using the character controller) by calling SimpleMove.

First off, I got this to work no problem with my player class. I copied the bits and adjusted them and applied them to my enemy class and its not working. The enemy sort of jerks in the forward direction for a few frames, then immediately goes the wrong direction for about 1.5 seconds, then jerks into the forward direction, etc…etc…

I’ve included this wonderful illustration to show what I mean. He move forward, then slides the wrong way for a bit, then forward. I have the character controller and character motor set up identical to my player class and its just not working. Any ideas?

using UnityEngine;
using System.Collections;

public class EnemyController : MonoBehaviour {
public int health;
public AudioClip hit;
public AudioClip die;
float distanceCheck;
Vector3 desiredDirection;
public Transform PlayerPosition;
public float runSpeed;
public float rotationSpeed;
CharacterController controller;
// Use this for initialization
void Start () {

animation["gethit"].layer = 2;
animation["gethit"].speed = 1f;
animation["waitingforbattle"].layer = 1;
animation["die"].wrapMode = WrapMode.ClampForever;
animation["die"].weight = 1;
animation["die"].layer = 3;
}

// Update is called once per frame
void Update () {
	controller = GetComponent<CharacterController>();
	distanceCheck = Vector3.Distance(PlayerPosition.position, transform.position);
	desiredDirection = (PlayerPosition.position - transform.position);		

	controller.SimpleMove(transform.forward * runSpeed);

	if (health <=0)
	{
		animation.Play("die");
		animation.wrapMode = WrapMode.ClampForever;
	}
	else		
		animation.CrossFade("waitingforbattle");

}

public void getHit(int damage)
{
	health -= damage;
	
	if (health > 0)
	audio.PlayOneShot(hit);
	else
	audio.PlayOneShot(die);
	
	animation.Play("gethit");
}

}

I suspect you may have some object with a collider childed to your character - the character controller behaves weirdly when some child collider touches its capsule: it “thinks” to be colliding with its own child and moves to weird directions. If you have such object, set its collider Is Trigger field, and the character will ignore it.

Bit late, but if others come this way with the same question, I’d like to provide my insights on this very problem:

Applying a SimpleMove() to a GameObject with a CharacterController may fail if that GameObject has a NavMeshAgent component attached.