You are on page 1of 1

using System.

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

public class CameraFollow : MonoBehaviour {

public GameObject player;

void LateUpdate () {
gameObject.transform.position = Vector3.Lerp(gameObject.transform.position, new
Vector3(0, gameObject.transform.position.y, player.gameObject.transform.position.z - 10),
Time.deltaTime * 100);
}
}

You might also like