- Home /
Question by
thef1chesser · Jan 20, 2014 at 08:29 AM ·
c#renderplane
How to get a plane and switch visibility?
In my program I start with a plane in front of the camera. At the click of a button or key press I want it to disappear. It should also be visible again when the button is pressed again.
How do I get access to the plane?
How to render and not render it?
plane name: PreScreen
Comment
Best Answer
Answer by thef1chesser · Jan 20, 2014 at 08:46 AM
Ok... maybe I should try more before asking. solved it.
GameObject PreScreen;
if (Input.GetKeyDown(KeyCode.P))
{
PreScreen = GameObject.Find("PreScreen");
PreScreen.renderer.enabled = !PreScreen.renderer.enabled;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613130922im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Problem with 3D objects rendering in front of closer objects. 1 Answer
Drawing line from plane edge 1 Answer
Does the clipping plane affect how well the game preforms? 1 Answer