25 lines
466 B
C#
25 lines
466 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class FaceCamera : MonoBehaviour
|
|
{
|
|
private Camera _camera;
|
|
|
|
private void Start()
|
|
{
|
|
_camera = Camera.main;
|
|
|
|
if (!_camera)
|
|
{
|
|
Debug.LogError("no main camera uh oh", this);
|
|
}
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
transform.forward = _camera.transform.forward;
|
|
}
|
|
}
|