15 lines
334 B
C#
15 lines
334 B
C#
using UnityEngine;
|
|
|
|
public class CameraFollow : MonoBehaviour {
|
|
GameObject _player;
|
|
Vector3 _offset;
|
|
|
|
void Start() {
|
|
_player = GameObject.FindGameObjectWithTag("Player");
|
|
_offset = transform.position;
|
|
}
|
|
|
|
void LateUpdate() {
|
|
transform.position = _player.transform.position + _offset;
|
|
}
|
|
} |