Can't Figure out How Disable Camera Y Position

When I jump with my player the camera moves up with the player. Camera is a parent of player to get that following horizontal look.
But, i need to disable the the camera’s y position when i jump to make it look smoother. Here’s a webplayer. Spacebar to jump.

https://dl.dropbox.com/u/56545886/ParanormalRunner/ParanormalRunner.html

using UnityEngine;
using System.Collections;

public class scrHudson : MonoBehaviour {

	//Variables
	
	private scrAnimationControls animScript;
	public Transform death;
	
	
	const float constantMove = 1;
//If it really is a constant speed you can declare it as such and it will prevent you from changing it.
//Otherwise just remove the modifier.
 
public float speed = 0.001f;
public float jumpForce = 1f;
//how fast do we move side to side and jump.
 
public float gravity = 9.8f;
 
private CharacterController controller; 
public Transform mainCam; 
public Vector3 fixedCamera; 
public bool stopCamera = false;
	
	

	
	
	
	
	
	
	
	
	
	
	
	// Use this for initialization
	void Start () 
	{
	  animScript = GameObject.Find("GameController").GetComponent<scrAnimationControls>();
	  controller = GetComponent<CharacterController>();
      mainCam = GetComponent<Transform>();
		
		jumpForce = 102f;
		//cache a link to the Character Controller.
	}
	
	// Update is called once per frame
	void Update () 
	{
	 FallDeath();
	

    

	
	
	Vector3 moveDirection = new Vector3( 0 , 0 , constantMove );
//Create a new Direction vector
if( controller.isGrounded) 
		{ //Are we touching the ground?
         moveDirection.x = Input.GetAxis("Horizontal") * speed;
          animation.CrossFade("run");
if( Input.GetKeyDown("space") ) 
{
            stopCamera = true;
			animation.CrossFade("jump");
	if(animation.IsPlaying("jump"))	
		   
			moveDirection.y = jumpForce; 
				
 
				
//Set the vertical direction to the jump speed.
 
moveDirection = transform.TransformDirection(moveDirection);
//You don't need this line since you will only be moving in one direction,
//But you will if your character rotates any.
}
}
 
moveDirection.y -= gravity * Time.deltaTime;
//This will pull the character back down.
controller.Move(moveDirection * Time.deltaTime);
//Move the character in the direction of moveDirection at a FPS independent rate.


if(!controller. isGrounded) 
	{ 
	 animation.CrossFade("fall");
	}
	

	
	if(stopCamera) 
		{
			//mainCam.transform.position = fixedCamera;
		    // stopCamera = false;
		}
	
	
	
	
	
	
	
}
	
	
	
	void FallDeath() 
{ 
	if(controller.transform.position.y <= -0.4f)
		{
			Application.LoadLevel(Application.loadedLevel);
		}
	
	
	
	
	}
	
	

	







}

Do you want the camera to stay even all the time (i.e. not move from it’s position when you jump)? Or do you want the camera to move with your character still, but more smoothly?

I don’t want the camera to move up when the player jumps. If you have a better suggestion I’m open to your ideas. It just doesn’t look smooth or natural atm.

Instead of attaching the camera as a child of the player, you could have a root node that the player and camera are both children of. Instead of moving the player around, you move the parent. Now the player is free to animate without affecting the camera.

I don’t often write in C# but should might help…untested just from the top of my head.

// var player is variable for the Player
//attached to camera
using UnityEngine;
using System.Collections;
public class example : MonoBehavior {
     public Transform player;
     void Update (){
     transform.position = Vector3(player.position.x, 1, -10);
     }
}

Thanks everyone I figured out the problem.