0
、私はこのエラーを取得:問題が
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
UnityEngine.Transform:SetParent(Transform)
私は同じエラーをGoogleを検索したが、ではないようです私の場合の問題。
コード:
[SerializeField] GameObject scoreboardItem;
[SerializeField] Transform playerList;
GameObject itemGO = (GameObject) Instantiate(scoreboardItem);
itemGO.transform.SetParent(playerList);
問題を解決するための任意のソリューション?
ドラッグしたプレイリストのインスペクタをインスペクタにドロップすることは、 'Project'パネルではなく' Hierarchy'パネルから行われることを確認してください。 – Hellium
そうすれば、私はプレハブを壊すので、それはうまくいきません。私はまた、GameObject.FindGameObjectWithTag()。transformでplayerListを検索しようとしましたが、同じエラーが発生しました。 –