using System.Collections; using System.Collections.Generic; using UnityEngine; public class SameGamesPos : MonoBehaviour { // Start is called before the first frame update public string RegionA_objStr; private GameObject RegionA_obj; void Start() { if (GameObject.Find("SceneRoot/" + RegionA_objStr) == null) return; RegionA_obj = GameObject.Find("SceneRoot/" + RegionA_objStr).gameObject; } private void LateUpdate() { if (RegionA_obj == null) return; this.gameObject.transform.position = RegionA_obj.transform.position; this.gameObject.transform.eulerAngles = new Vector3(RegionA_obj.transform.eulerAngles.x, RegionA_obj.transform.eulerAngles.y, RegionA_obj.transform.eulerAngles.z); } }