Hey, thanks for taking the time to help me. I’m very basic with Unity Scripting and C#.
Here’s a basic billboard script which rotates something to the direction of an attached camera. I was wondering if I can make it so that it only rotates the x-axis.
using UnityEngine;
using System.Collections;
public class CameraFacingBillboard : MonoBehaviour
{
public Camera m_Camera;
void Update()
{
transform.LookAt(transform.position + m_Camera.transform.rotation * Vector3.forward,
m_Camera.transform.rotation * Vector3.up);
}
}
I’m trying to make billboard enemies from sprites in a 3D world. However, there’s an issue with looking directly downwards from a high viewing point at the billboarded enemy as it looks like its laying down. Any help would be appreciated.