Distance checking not working on build

I have a problem.
The distance check works fine in the editor, however, I have to run it, stop it and then run it again for its work. As well as that, it is completely broken on a build (buttons can be pressed from any distance).

The code:

public class UpToLevel : MonoBehaviour {
private GameObject player;

void Update()
{
    player = GameObject.Find("FPSController");
    var distance = Vector3.Distance(player.transform.position, transform.position);
    //print (distance);
}

void OnMouseDown()
{
    var distance = Vector3.Distance(player.transform.position, transform.position);
    if (distance > 3.0)
    {
        SceneManager.LoadScene("DemoLevel");
    }
}

Any help? Built to Windows x86_64

Are you sure you have only one FPSController object on scene?
Secondly i recommend you to don’t use GameObject.Find in Update function for performance reasons. There is no need to do this every frame. Use Start() for this.