what I want to do is to make the brain mesh appear/disappear with the toggle button at the bottom/left side.
so I made a javascript like this
#pragma strict
var toggleG : boolean;
var LG_P0 : boolean;
var LG_P1 : boolean;
function Start () {
toggleG = GameObject.Find("ToggleGM").GetComponent("isOn");
LG_P0 = GameObject.Find("LG_Part0").GetComponent("Mesh Renderer");
LG_P1 = GameObject.Find("LG_Part1").GetComponent("Mesh Renderer");
}
function Update () {
if (toggleG == true){
LG_P0 = true;
LG_P1 = true;
}
else{
LG_P0 = false;
LG_P1 = false;
}
}
but as you may guess I failed.
to summarize,
May I ask for a javascript that makes a mesh called “LG_Part0” appear/disappear with a toggle button “Toggle(GM)”??