Answers for "unity attach camera to gameobject"

0

unity attach camera to gameobject

using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
   
    public class RotateWithCam : MonoBehaviour
    {
        public GameObject go;
    void LateUpdate()
        {
          //attach Game Object go to target
            Transform target = Camera.main.transform;
            go.transform.parent = target;
        }
    }
Posted by: Guest on April-29-2021

Browse Popular Code Answers by Language