【3Dゲームエンジン】Unity 4at GAMEDEV
【3Dゲームエンジン】Unity 4 - 暇つぶし2ch859:名前は開発中のものです。
15/08/10 21:19:10.44 7mxq3sqw.net
エラーはこれです
error CS0120: An object reference is required to access non-static member `UnityEngine.Component.transform'
error CS1502: The best overloaded method match for `UnityEngine.Transform.SetParent(UnityEngine.Transform, bool)' has some invalid arguments
CS1503: Argument `#1' cannot convert `object' expression to type `UnityEngine.Transform'

親のソースはこれです
public GameObject obj;
void Update () {
Instantiate(obj,new Vector3(0.0f, 0.0f, 0.0f),Quaternion.identity );
obj.transform.SetParent (Canvas.transform ,false);
}
objにはインスペクタで増やしたいオブジェクトを入れています
子に書いてゲットコンポーネントもするのが正解なのか…うーん・・・


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch