onMouseDown controlling visibility

Hello, I’m newbie & just learning Js

I have many textured planes
near them are other textured planes with their mesh off so they are hidden.

I want to create a script to click on one plane and have the visibility of the other turn on
I have to do this for a number of assets so I am wondering
a) how to do this and
b) wondering if there is not a way to automate it somehow with dragging both planes into a game object

but the script I have for the first part of my question doesn’t even work

function OnMouseUp( ) {

if (Plane_3b.renderer.enabled = false) {
    Plane_3b.renderer.enabled = true; 
if (Plane_3b.renderer.enabled = true) {
    Plane_3b.renderer.enabled = false; 


Thank you in advance

it’s not working bcoz you have written both conditions in If…so it always goes to 2nd if.

second condition should be ‘else if’…
its working then.

The problem is now identifying the specific plane. In the hierarchy it is called Plane_3b, but it’s an “unknown identifier”

function OnMouseDown( ) {

if (Plane_3b.renderer.disabled) {



else if (Plane_3b.renderer.enabled) {