To sum this up the best I can:
I have some code that sets a boolean value to true. When this little checkbox is enabled, it works as intended, allowing the game to function normally.

However, later on the code at some point sets this boolean to false (remember, it is a public boolean). Unfortunately, when this checkbox enabled. The console reads "true, false, true, false" etc. which prevents the desired outcome.

If I disable this checkbox, then the output reads "false, true, false, true" etc. which prevents anything from working.

Is there a way of disabling this stupid checkbox from having any effect in the game? I have tried [system.nonserialized] to no effect. At least, is there a way to disable and enable this checkbox in code?
As requested, here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class startAgain : MonoBehaviour {
public bool start;
// Use this for initialization
void Start () {
//start = true;
}
public void use ()
{
start = true;
}
// Update is called once per frame
void Update () {
print(start);
}
public void rest()
{
StartCoroutine(Waittostart());
Vector3 ball = GameObject.Find("Ball").transform.localPosition = new Vector3(0,0,0);
Transform lpadlx = GameObject.Find("Player Paddle").transform;
Vector3 lpadpos = lpadlx.position;
Vector3 leftpaddle = GameObject.Find("Player Paddle").transform.position = new Vector3(lpadpos.x, 0, 0);
Transform rpadlx = GameObject.Find("AI Paddle").transform;
Vector3 rpadpos = rpadlx.position;
Vector3 rightpaddle = GameObject.Find("AI Paddle").transform.position = new Vector3(rpadpos.x, 0, 0);
}
IEnumerator Waittostart()
{
print("RUNNING!");
start = false;
yield return new WaitForSeconds(2);
start = true;
}
}
(please note that some of this was used for debug, so some bits will be out of place just to test it!)
Thanks! I hope this was clear enough.