UCE0001: ';' expected. Insert a semicolon at the end.

using UnityEngine;
using System.Collections;

public class HatController : MonoBehaviour {

	public Camera cam;
	private float maxWidth;
	
	void Start () {
		if (cam == null) {		
			cam = Camera.main;
		}
		Vector3 upperCorner = new Vector3 (Screen.width, Screen.height, 0.0f);
		Vector3 targetWidth = Cam.ScreenToWorldPoint (upperCorner);
		float hatWidth = renderer.bounds.extents.x;
		maxWidth = targetWidth.x;
	}
	
	void FixedUpdate () {
		Vector3 rawPosition = Cam.ScreenToWorldPoint (Input.mousePosition);
		Vector3 targetPosition = new Vector3 (rawPosition.X, 0.0f, 0.0f);
		float targetWidth = Mathf.Clamp (targetPosition.x, -maxWidth, maxwidth);
		targetPosition = new Vector3 (targetWidth, targetPosition.y, targetPosition.z);
		rigidbody2D.MovePosition (targetPosition);
	}		
}

by the way i got this code from youtube tutorial making a 2D catch game. But i have this error at line 1 and 6. please help why is this wrong but in his tutorial this is correct

C# is a case sensitive language. “Cam” and “cam” differs. You have various syntax errors in your code. “maxWidth” - “maxwidth”, “Cam” - “cam” are all different things. Fix them.

Also Unity 4.3 doesn’t have rigidbody2D.MovePosition(), it came with 4.5, be sure you are using Unity 4.5.

Also be sure your file name is “HatController.cs”