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

19 lines
383 B
C#
Raw Normal View History

2024-04-21 13:10:34 +02:00
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);
}
}