Why isn't this working? :)

Hey there :slight_smile:

My main goal is this Imgur: The magic of the Internet

So I started on making a script to do that but it just won’t work :confused:

here is the error: NullReferenceException: Object reference not set to an instance of an object

and the script

I really need help, I’m very new to scripting :confused:

Thank you

Paste this one it will work

var Part1: Transform;

var Part2: Transform;

function OnGUI () {

// Make a background box

GUI.Box (Rect (10,10,100,90), “Parts”);

if (GUI.Button (Rect (20,40,80,20), “Pipe”)) {

Instantiate (Part1, Vector3(1, 0, 0), Quaternion.identity);

}

if (GUI.Button (Rect (20,70,80,20), “Funnel”)) {

Instantiate (Part2, Vector3(1, 0, 0), Quaternion.identity);

}

}

I will try, thank you :slight_smile:

It worked perfectly! thank you