using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RelicGGJ;

public class LerpCamera : CameraController
{

    public float m_speed = 2f;

	// Use this for initialization
	void Start ()
    {
		
	}
	
	// Update is called once per frame
	void Update ()
    {
		if (m_player != null)
        {
            Vector2 playerPos = new Vector2(m_player.position.x, m_player.position.y);
            Vector2 cameraPos = new Vector2(transform.position.x, transform.position.y);
            Vector2 lerpPos = Vector2.Lerp(cameraPos, playerPos, Time.deltaTime * m_speed);
            transform.position = new Vector3(lerpPos.x, lerpPos.y, transform.position.z);
        }
	}
}
