- Home /
Question by
Will 15 · Dec 24, 2010 at 03:22 AM ·
camerabuild-errordebugcameras
"It is not possible to invoke an expression of type 'boolean'" in switching cameras
Here is my code:
var Building_Camera : Camera; var Catapult_Camera : Camera;
function Update() {
if (Input.GetButton ("e")){ Building_Camera.enabled(false); Catapult_Camera.enabled(true);
}
if (Input.GetButton ("r")){ Building_Camera.enabled(true); Catapult_Camera.enabled(false);
}
}
pretty basic, but I get the following error in all of the camera lines: It is not possible to invoke an expression of type boolean. If this code is in correct could you tell me another way to change the camera view. I mean, if I have two cameras and want to change between them. Thnks...
Comment
Answer by Jesse Anders · Dec 24, 2010 at 03:40 AM
'enabled' is a field/property, not a function, so you want (e.g.):
Building_Camera.enabled = false;