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

public class CameraFollow : MonoBehaviour {

    public Transform target;

    Vector3 velocity;

    void Start()
    {
        transform.position = target.position;
    }

    void FixedUpdate()
    {
        if (target != null)
            transform.position = Vector3.SmoothDamp(transform.position, target.position, ref velocity, 0.4f);
    }
}
