Hi,
i can’t instantiate my prefab, i read through the topics in the forum but i did not find any solution. Here is what i did :
-add a plane and a character to the scene,
-put them in an empty in “Hierarchy”.
-Then, i created a prefab in Project, and i dragged and dropped the empty into this prefab.
-I then removed the empty from Hierarchy, and attached this script to the main camera :
function Start () {
//var instance : GameObject = Instantiate(Resources.Load("Prefabs/total", GameObject));
//var instance : GameObject = Instantiate(Resources.Load("total", GameObject));
var instance : GameObject = Instantiate(Resources.Load("total"));
//instance.transform.position = Vector3.zero;
}
function Update () {
}
But i have this error :
ArgumentException: The thing you want to instantiate is null.
UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message)
UnityEngine.Object.Instantiate (UnityEngine.Object original)
I tried to put the prefab in a folder, or just in “Project”, but i have got the same result.
Any idea?
Thanks