Make an object invisible from script

Is it possible to make a game object invisible? I tried to change the opacity of the material’s color but it still appears in the scene.

To make a gameobject invisible you can disable its renderer component. If you dont need the object in the scene right now (including script functionality) you may also just disable the entire gameobject.

2 Likes

One way you could do it is to deactivate the game-object during the script so it doesn’t appear in the scene:

public GameObject OBJECT1;

void Update();
{
 // Collision/Way to Trigger
  OBJECT1.SetActive(false);
    }
}
3 Likes

I want to make it invisible but listen to onTriggerEnter events.

1 Like

I want to make it invisible but listen to onTriggerEnter events.

Then, as i said, get its renderer component and set it to disabled. This just turns off rendering fucntionality, ie making the object invisible, while keeping all other scripts running.

6 Likes

thankyou