コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

2021-06-17から1日間の記事一覧

【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 // ★ ); } } 新しいゲームオブジェクトをスクリプトから生成する時に…