I dont understand this output, and how to fix it?

var camera1 : Transform;
var camera2 : Transform;

function Update () {
if(Input.GetButton("View")){
camera1.camera.enabled == true;
}
else {
camera1.camera.enabled == false;
}
}

This is the output

Assets/Scripts/CameraScript.js(6,24): BCE0034: Expressions in statements must only be executed for their side-effects.

Also, I am making a button wich will change the view.
Thanks for reading! :wink:

== is a comparison.
x == y will be true if x is equal to y

= is an assignment
x = y makes x equal y

This is one of the more tricky errors to read, but what its basically saying is that you are doing /nothing/ in a given statement…

camera1.camera.enabled == true

is actually a boolean value, that you aren’t doing anything with…

I suspect you want

camera1.camera.enabled = true

Thank you guys, you helped me alot!
High Five