Player Controller and color changer
This commit is contained in:
19
Assets/Scripts/CameraController.cs
Normal file
19
Assets/Scripts/CameraController.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraController : MonoBehaviour
|
||||
{
|
||||
public GameObject player;
|
||||
private Vector3 offset;
|
||||
|
||||
void Start()
|
||||
{
|
||||
offset = transform.position - player.transform.position;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
transform.position = player.transform.position + offset;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user