【3Dゲームエンジン】Unity 4 [転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0856名前は開発中のものです。
2015/08/10(月) 21:19:10.44ID:7mxq3sqwerror 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にはインスペクタで増やしたいオブジェクトを入れています
子に書いてゲットコンポーネントもするのが正解なのか…うーん・・・
■ このスレッドは過去ログ倉庫に格納されています