Created
November 12, 2020 15:56
-
-
Save samsheffield/f1b8de8790e7cb2ea41da2008c3b28e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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