Q:

unity instantiate prefab

Instantiate(myPrefab, new Vector3(0, 0, 0), Quaternion.identity);
6
using UnityEngine;

public class example : MonoBehaviour
{
	public GameObject prefab;
    
	// Start is called before the first frame update
	void Start()
	{
		Instantiate(prefab, new Vector3(0, 0, 0), Quaternion.identity);
	}
}
3
// You can use the 'Instantiate()' function to clone a GameObject
clone = Instantiate(original);

// You can also set the position, rotation and parent
clone = Instantiate(original, new Vector3(0, 0, 0), Quaternion.identity, cloneParent.transform);
21
Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity);
2
     //Instantiate Object
     GameObject go = Instantiate(A, new Vector3 (0,0,0), Quaternion.identity) as GameObject;
     // Tranform as child
     go.transform.parent = GameObject.Find("Stage Scroll").transform;
0

New to Communities?

Join the community