Answers for "unity add new object prefab"

C#
4

unity create gameobject from prefab in script

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);
	}
}
Posted by: Guest on September-12-2020
4

unity how to create a prefab

To create a Prefab Asset, drag a GameObject
from the Hierarchy window into the Project window.
Posted by: Guest on January-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language