Stratasys-450mc-VR/Assets/Scripts/SimpleBillboard.cs
2023-11-02 22:14:02 -04:00

24 lines
514 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleBillboard : MonoBehaviour
{
private void Start()
{
StartCoroutine(LookAtCamera());
IEnumerator LookAtCamera()
{
if (Camera.main == null) yield break;
Transform targ = Camera.main.transform;
while (true)
{
transform.LookAt(targ);
yield return null;
}
}
}
}