Can read but cannot pass variables between scripts...

Hey. So I have a public bool assigned to the public bool from a script connected with another gameObject. I want to change the boolean value of the remote script when my raycast encounters an “enemy” tag. After testing I’ve determined that I am getting the true value of BattleTime.On() and that my raycasting is working as intended, but I cannot alter the value of BattleTime.On().
Here is my player script:

    public bool battletime;
    	public void Update() {
    		
    		battletime = GameObject.Find("Manager").GetComponent<BattleTime>().on;

		RaycastHit hitInfo1;
		Ray ray = new Ray (transform.position, new Vector3(0,0,-1));
		if (Physics.Raycast (ray, out hitInfo1, Mathf.Infinity)) {
			if (hitInfo1.collider.gameObject.CompareTag ("enemy")) {
				//Physics2D.Raycast (ray1, out hitInfo1, Mathf.Infinity)) {
				battletime = true;
				Debug.Log (battletime);
			}} else {
			battletime = false;
			Debug.Log (battletime);
		}



    And here is the constant script, located in the Manager gameObject:



    	
    public bool on;
    		void Update(){
    		if (on == true)
    						Debug.Log ("it is true");
    				else
    						Debug.Log ("lies");
    
    	}

Turning ‘on’ into a static script does not help. Anyone got any ideas?

This is how I do it. Instead of this

battletime = GameObject.Find("Manager").GetComponent<BattleTime>().on;

I do

battletime = GameObject.Find("Manager").GetComponent<BattleTime>();

and then instead of

battletime

I do

battletime.on == ....

I haven’t tried the method you are using with the direct reference, not saying it’s wrong, just the method that I
Try this site too:
http://unitygems.com/script-interaction1/