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.