Skip to content

Instantly share code, notes, and snippets.

@samsheffield
Created November 12, 2020 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsheffield/f1b8de8790e7cb2ea41da2008c3b28e3 to your computer and use it in GitHub Desktop.
Save samsheffield/f1b8de8790e7cb2ea41da2008c3b28e3 to your computer and use it in GitHub Desktop.
// Code based on CameraFacingBillboard by Nei Carter: http://wiki.unity3d.com/index.php?title=CameraFacingBillboard
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Billboard : MonoBehaviour
{
public Transform cameraTransform;
void LateUpdate()
{
transform.LookAt(transform.position + cameraTransform.rotation * Vector3.forward, cameraTransform.rotation * Vector3.up);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment