using System.Collections; using System.Collections.Generic; using UnityEngine; public class SetCanvasCamera : MonoBehaviour { public Canvas canvas; public Camera targetCamera; // Start is called before the first frame update void Start() { canvas = GetComponent(); targetCamera = GameObject.Find("XROriginHands/Camera Offset/Main Camera").GetComponent(); if (canvas!=null) { if (canvas != null && targetCamera != null) { canvas.worldCamera = targetCamera; } } } }