Vector 3 with 'or' statement issues

The problem is at my function Update, second line from there. I don’t know how to fix it so it works.

The error it gives

“InvalidCastException: Cannot cast from source type to destination type.
GateScript.Update () (at Assets/Scripts/GateScript.js:27)”

This is my code

private var open : boolean = false;

var openAnimationString : String;
var closeAnimationString : String;

var button1Transform : Transform;
var button2Transform : Transform;
//var button3Transform : Transform;
var distToOpen : float = 6;

private var playerTransform : Transform;
private var cameraTransform : Transform;

var openSound : AudioClip;
var closeSound : AudioClip;

function Awake () {
	playerTransform = GameObject.FindWithTag("Player").transform;
	cameraTransform = GameObject.FindWithTag("MainCamera").transform;
	if(open)
		animation.Play(openAnimationString);
}

function Update () {
	var alreadyChecked : boolean = false;
	if (Vector3.Distance(playerTransform.position,button1Transform||button2Transform.position) <= distToOpen)
	if (Input.GetKeyDown("e") && !animation.isPlaying)
	{
		if(open)
		{	
			animation.Play(closeAnimationString);
			open = false;
			alreadyChecked = true;
			if (closeSound)
				audio.PlayOneShot(closeSound);
		}
		if (!open && !alreadyChecked)
		{
			animation.Play(openAnimationString);
			open = true;
			if (openSound)
				audio.PlayOneShot(openSound);
		}		
	}
}

This is not the correct way to format that conditional. Unless I’m mistaken, the only syntactically correct way to accomplish what you want is like this:

if (Vector3.Distance(playerTransform.position, button1Transform.position) <= distToOpen || Vector3.Distance(playerTransform.position, button2Transform.position) <= distToOpen) {

Hope that helps,

Klep