Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues. UnityEngine.Transform:set_parent (UnityEngine.Transform)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SAveOnLoad : MonoBehaviour { public GameObject ChildObj; void Start() { ChildObj.transform.parent = null; } void Update() { DontDestroyOnLoad(ChildObj); } }
Quote:Consider using the SetParent method instead, with the worldPositionStays argument set to false.
Quote: This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)