Hi,
Im having some trouble with character controller, things work fine on flat surfaces, the enemys have a constant speed but when it comes to slanted surfaces (it seems downwards) they get stuck, somtimes fully and sometimes they move much much slower. Ive adjusted the skin width to be as suggested (10%) and ive played with gravity but nothing seems to fix this problem.
This is the basic code:
if(controller.isGrounded)
{
animation.CrossFade(WalkAnim);
animation[WalkAnim].speed = AnimSpeedModifier;
direction = chasee.transform.position - transform.position;
direction.Normalize();
direction = (direction * (Speed * SpeedModifier));
direction.y = 0.0f;
}
direction.y -= 9.81f* Time.deltaTime;
controller.Move(direction * Time.deltaTime);
Notice as a fix I tried to stop the enemy moving along Y axis all together and let gravity sit them to the floor.
If anyone has any advice, please let me know
Ashley.