player controller fix, ground controller, manager object
This commit is contained in:
@@ -5,15 +5,16 @@ using UnityEngine;
|
||||
public class CameraController : MonoBehaviour
|
||||
{
|
||||
public GameObject player;
|
||||
public Camera camera;
|
||||
private Vector3 offset;
|
||||
|
||||
void Start()
|
||||
{
|
||||
offset = transform.position - player.transform.position;
|
||||
offset = camera.transform.position - player.transform.position;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
transform.position = player.transform.position + offset;
|
||||
camera.transform.position = player.transform.position + offset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user