Stratasys-450mc-VR/Assets/Scripts/SimpleBillboard.cs

24 lines
514 B
C#
Raw Normal View History

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;
}
}
}
}