How can I make a GameObject invisible while maintaining its interractivity?

I’ve found out the correct answer but I don’t know how to use it. I saw that I must write this somewhere: GetComponent(MeshRenderer).enabled = false;

The question is where? Where must I write this?

You would call that in a MonoScript Component that is on that object. For example, in UnityScript:

function Start() {
   GetComponent(MeshRenderer).enabled = false;
}

Click Add Component in the inspector on your object to add a new script component, or by using the top Unity menu system.

Read this, it will help you understand the GameObject/Component relationship.

Create a new script and name it something like “MakeInvisible” or “MakeTransparent” then open that script in a text editor like Monodevelop which comes with Unity3D by default. When you open the script in Monodevelop it will have a few premade functions, the first being Function Start() write your code in that function between the {} like this:

Function Start (){
##Your code goes here##
}

if your still lost, i suggest you look at some tutorials, in fact, it might be a good idea to look at them anyways.

@Noobfest
try this man

gameObject.GetComponent().enabled=false;