using UnityEngine;
using System.Collections;

public class CameraMover : MonoBehaviour {
	public Transform followTarget;

	public float lowerExtent = -4f;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		transform.position = new Vector3 (followTarget.position.x, followTarget.position.y, -10f);

		if (camera.ViewportToWorldPoint (new Vector3 (0f, 0f, 0f)).y < lowerExtent) {
			transform.position += new Vector3(0f, lowerExtent - camera.ViewportToWorldPoint (new Vector3 (0f, 0f, 0f)).y, 0f);
		}

	}
}
