First Person Character, Mecanim.

Hello fellow developers!

Today, I have a problem where I have made a First Person Character which has gone quite successful apart from the fact where I walk forward and then you can see his head.

  1. ![alt text][1]

[1]: http://oi62.tinypic.com/2435jjr.jpg - Idle (Good)

  1. ![alt text][1]

[1]: http://i59.tinypic.com/152jawy.jpg - Walking (Bad)

  1. ![alt text][1]

[1]: http://i62.tinypic.com/9i9po4.jpg - Running (Bad)

PROBLEMS WITH THE PICTURES First is idle, looks good. Second is walking, you can see his head. Third is running, you can almost see all his body.

So as you can see from the diagrams, I do not want this to happen.

First, I have parented the camera on to the head, which is rather cool, but annoying after a minute of running, too shaky, etc. I attempted camera lerping, but I am not experienced in that field.

Please tell me your solutions.

Thanks,

Dimitri

For anyone who has a similar problem, I managed to figure it out on my own eventaully.

  1. Parent the camera on the Rigidbody/Player, wherever the main parent is, do NOT parent it on the head of the 3D model.
  2. You can see that the MainCam’s posiiton is first in this Vector3.Lerp, and basically when I hold the Left Shift key, the boolean Running becomes TRUE, and that makes the Lerp begin.

If I did not explain this very well, please let me know.

if (Running == true) {
				MainCam.transform.position = Vector3.Lerp (MainCam.transform.position, RunObj.transform.position, theTime);				
			}
			
			if (Running == false) {
				MainCam.transform.position = Vector3.Lerp (MainCam.transform.position, IdleObj.transform.position, sprintTime);				
			}
		}