Ive followed a tutorial on 3dbuzz 1 on a 3rd person character system. The system uses character controller component and not rigidbody. The problem im facing is walking down hills in my terrain, when i walk down a hill the character walks out into nothing horizontally then falls back to the ground. Ive tried using a raycast to detect when im not grounded and forcing character to the ground, but it gave a lot of stutters and when i walk upwards the hill the character sometimes fell through the terrain.
RaycastHit hit;
if (Physics.Raycast(transform.position, Vector3.down, out hit)) {
transform.position = hit.point;
}