Global Game Jam 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
523 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class LookAtCamera : MonoBehaviour
{
private void Awake()
{
UpdateRotation();
}
[ContextMenu("Update Rotation")]
public void UpdateRotation()
{
var _cameraObj = Camera.main.gameObject;
transform.rotation = _cameraObj.transform.rotation;
transform.Rotate(new Vector3(0, 180, 0));
}
private void LateUpdate()
{
UpdateRotation();
}
}