Hi Folks!
I’m wrapping up an app I’ve built and one of the late additions requested was an effect that needed sprites distributed around the scene that face the camera. Ok done. Got a wonderful script here (thanks so much!) that works great with a single camera. Issue here is that I’ve got 2. An orbit camera, and a FPS cam that you can switch back and forth to. In the code (below) I tried simply swapping “Camera.main” with “Camera.current” but no dice. sprite doesn’t rotate. I was kinda hoping it was that simple.
Any ideas?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LookAtCam : MonoBehaviour
{
private Camera theCam;
// Start is called before the first frame update
void Start()
{
theCam = Camera.main;
// changed this to "Camera.current" but no luck
}
// Update is called once per frame
void LateUpdate()
{
transform.LookAt(theCam.transform);
}
}