revival/game/Assets/Scripts/UI/FaceCamera.cs

25 lines
466 B
C#
Raw Permalink Normal View History

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;
}
}