New here so this has probable been ask 100 times, but I an having in issue with Instantiate, can could use some help.
I created a cube then a prefab which I named “Timtest”
the folder my prefabs in is called…
…Assets/prefab
I build a collider on nother object so that when player hit the object a script will build the prefab. (or a least I’m trying to build that script) That scripted is called “BuildHed” and is below…
var Timtest : GameObject;
function OnTriggerEnter(Other : Collider)
{
if (Other.tag == “Player”)
{
var h : GameObject = Instantiate(Timtest);
}
}
I am getting error on the 7th line,…
The variable Timetest of Timtest of BuildHed has not been assigned.
I do not know why I am getting this error,
Any help would be greatful.
Duhhhhhh…I am stupid… such a simple thing to overlook
The Script I was making just before this one, I was getting the GameObject by code and when I made this one I overlooked that I had drop the GameObject into the Inspector panel…