3DTD/Assets/Scripts/Utilities/CanvasToView.cs

19 lines
383 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CanvasToView : MonoBehaviour
{
Camera mainCam;
Canvas canvas;
void Awake()
{
mainCam = Camera.main;
canvas = GetComponent<Canvas>();
}
private void Update()
{
canvas.transform.LookAt(mainCam.transform.position);
}
}