23 function calls while ignoring logic?

Hello, I am having an issue that I can’t understand. I have a series of functions and I can’t get them to run correctly. Here is a generic version of what I am looking at:

	private bool doFunctions = false;

	public void Start()
	{
		if (!doFunctions)
		{
			doFunctions = true;
			function1();
			function2();
			function3();
		}
	}

	public void function1()
	{
		Debug.Log("Inside Function 1");
	}

Now I am not familiar yet with Unity. I have only been using it for a few days. Function 1 according to the Console is being called 23 times. How does function 1 get called 23 times? Shouldn’t it get stopped by the doFunctions being switched to True? If I set doFunctions to True, it never calls the functions, which makes sense. But if it is false, Unity seems to just plow through 23 calls before stopping.

I have moved this to Update() with no change and had it only called after a keypress, also with no change. 23 calls.

Any help or understanding is appreciated. Thanks.

Well I think I figured out my own question. This script is a MonoBehaviour and it was attached to 23 objects in the scene. Each time it ran, the variable was false and it did it’s job and ran once… per object.

seems like you have your logic backwards, or the logic is completely pointless (atm)

translation to english… if doFunction equals false… set value to true, call functions 1-3