Same script working yesterday not working today

Hello,
I made a script that makes a list of the childs of an object and then sets them active one at a time using a coroutine. The script is suscribed to an event on another script’s Start function for testing reasons. It worked perfectly yesterday, but today after opening the project again and pressing play, it didn’t work :S could be something to do with the event? or the coroutine?

public class FootPrintManager : MonoBehaviour {

	public delegate void FootstepsShot();
	public static event FootstepsShot FootstepsEnd;

	public float delayTime = 1.0f;

	public List<GameObject> footsteps;

	void OnEnable(){
		AnimController.ShotLight += StartSteps;
	}
	void OnDisable(){
		AnimController.ShotLight -= StartSteps;
	}

	public void StartSteps(){
		foreach(GameObject step in footsteps){
			StartCoroutine("Walking");
		}
	}


	void Start () {
		footsteps = new List<GameObject>();
		foreach(Transform steps in transform){
			footsteps.Add(steps.gameObject);
		}
	}
	

	IEnumerator Walking(){
		
		foreach(GameObject step in footsteps){
			yield return new WaitForSeconds(delayTime);
			step.SetActive(true);
		}
	}
}

Thanks!

The order of the two scripts is important in your case. The Start function in one script must start before the other one starts. Unfortunately the order can be random and can be different on different platforms and devices. You can however define an order to specific scripts with Edit–>Project settings → Script execution order. Add your script that has to be executed first and give it a negative number to be sure it starts first.

I just found out what it was, maybe I was lucky the first time I ran the script it filled the list of gameobjects “before” I was reading it in the StartSteps function. The solution was to change my Start() function to an Awake() function and now the List gets filled before trying to access it.