以下の内容はhttps://baba-s.hatenablog.com/entry/2021/06/17/090000より取得しました。


【Unity】Cannot instantiate objects with a parent which is persistent. New object will be created without a parent.

概要

using UnityEngine;

public class Example : MonoBehaviour
{
    public GameObject m_prefab;

    private void Awake()
    {
        Instantiate
        (
            original: m_prefab, 
            parent: m_prefab.transform // ★
        );
    }
}

新しいゲームオブジェクトをスクリプトから生成する時に
そのゲームオブジェクトの親にプレハブを指定してしまっていると

Cannot instantiate objects with a parent which is persistent. 
New object will be created without a parent.

このエラーが発生する




以上の内容はhttps://baba-s.hatenablog.com/entry/2021/06/17/090000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14