Maras
3
Q:

unity create gameobject from prefab in script

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
Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity);
2

New to Communities?

Join the community