ok now look at that
why when i build it it gives me an error
i’ll give you all the scripts i need to make the boolean true from other scripts … look
But i dont want to edit Cube.js i want to edit ((RED CAM.js, BLUE CAM.js))
and BLUE, RED Scripts that i want to make the boolean true;
[19172-red+blue.png|19172]
What you are trying to do is really confusing. Here is what I’d do… given your requirements…
I’d make two cameras. I’d name one RED_CAMERA, and one BLUE_CAMERA.
Then I’d have a single script. Cube.js
function Update()
{
if(Camera.current.gameObject.name == 'RED_CAMERA') {
renderer.material.color = Color.red;
}
...
}
Peter_G
December 10, 2013, 4:29pm
2
‘RED’ and ‘BLUE’ are instance variables (compare to class/static variables ). You need to find the instance to access there values. The easiest way to do that is:
var cube = FindObjectOfType( Cube );
cube.RED = true;