using UnityEngine; namespace Unheimlich.Features.Dialogue.UI { /// /// Makes UI element always face the main camera. /// Commonly used for world-space UI elements like floating words. /// public class BillboardUI : MonoBehaviour { private Transform _cameraTransform; private void Awake() { _cameraTransform = Camera.main != null ? Camera.main.transform : null; if (_cameraTransform == null) Debug.LogWarning($"BillboardUI on {gameObject.name}: Main camera not found!"); } private void Start() { } private void LateUpdate() { if (_cameraTransform != null) { transform.LookAt(transform.position + _cameraTransform.rotation * Vector3.forward, _cameraTransform.rotation * Vector3.up); } } } }