Files
survival-game/Assets/Mirror/Examples/_Common/Scripts/FaceCamera.cs
2025-06-16 13:15:42 +00:00

16 lines
367 B
C#

// Useful for Text Meshes that should face the camera.
using UnityEngine;
namespace Mirror.Examples.Common
{
[AddComponentMenu("")]
public class FaceCamera : MonoBehaviour
{
// LateUpdate so that all camera updates are finished.
void LateUpdate()
{
transform.forward = Camera.main.transform.forward;
}
}
}