using UnityEngine;
using System.Collections;

public class CameraFollow : MonoBehaviour {

	public Transform Player;
	public float VOffSet;
	public float VLagOnMove;
	public float VLagLerpTime;
	
	private PlayerMovementController moveCtrl;
	private float vlag=0;

	// Use this for initialization
	void Start () {
	
	}
	
	void LateUpdate () {
		vlag = VOffSet;// - 0.3f * (Player.rigidbody2D.velocity.y - 3f);

		float px = 0.9f;
		float py = Player.transform.position.y + vlag;

		transform.position = new Vector3(px,py, -10);
	}


	private void ExploreFollow()
	{
		Vector2 playerFwdVel   = ((Vector2)Player.up).normalized * Vector2.Dot((Vector2)transform.up, Player.rigidbody2D.velocity);
		transform.position = new Vector3(Player.position.x, Player.position.y, -10) + 0.3f * (Vector3)playerFwdVel;
		transform.eulerAngles = Player.eulerAngles;
		return;
	}
}
