Initial commit: Unity project setup
This commit is contained in:
14
Assets/Scripts/CameraFollow.cs
Normal file
14
Assets/Scripts/CameraFollow.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraFollow : MonoBehaviour {
|
||||
public GameObject player;
|
||||
private Vector3 offset;
|
||||
|
||||
void Start() {
|
||||
offset = transform.position;
|
||||
}
|
||||
|
||||
void LateUpdate() {
|
||||
transform.position = player.transform.position + offset;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user