17 lines
398 B
C#
17 lines
398 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class CameraFollow : MonoBehaviour {
|
|
public GameObject player;
|
|
private Vector3 offset;
|
|
// Use this for initialization
|
|
void Start () {
|
|
offset = transform.position - player.transform.position;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void LateUpdate () {
|
|
transform.position = player.transform.position + offset;
|
|
}
|
|
}
|