Coroutines not working

Coroutines not working (?)

void LoadSplashScreen()
{
    // Load the splash screen first
    SceneManager.LoadScene("SplashScreen");
    Debug.Log("load SplashScreen");
      
    StartCoroutine(LoadTargetSceneWithDelay());
}
IEnumerator LoadTargetSceneWithDelay()
{
    yield return new WaitForSeconds(3f); 
    Debug.Log("Delayed");
    
    int index = CalculateSceneIndex();
    Debug.Log("Calculate index" + index);
    
    SceneManager.LoadScene(index);
    Debug.Log("Loading index" + index);
}
public int CalculateSceneIndex()
{
    float rot = transform.eulerAngles.z;
    if (rot > 0  && rot <= 45) return 3;
    else if (rot > 45  && rot <= 90) return 1;
    else if (rot > 90 && rot <= 135) return 4;
    else if (rot > 135 && rot <= 180) return 2;
    else if (rot > 180 && rot <= 225) return 3;
    else if (rot > 225 && rot <= 270) return Random.Range(2, 4);
    else if (rot > 270 && rot <= 315) return 4;
    else if (rot > 315 && rot <= 360) return 2;
    else  return 0;
}

Why not use the Splash Screen as a UI canvas in the first scene then simply load “Target scene with delay” afterwards, that way you can avoid loading a new scene just to show a splash screen here SceneManager.LoadScene(“SplashScreen”);
Instead, simply make your Splash Screen a UI in the current scene, and enable it like this:

GameObject _splashScreen;

_splashScreen.SetActive(true);
// And then load the target scene
StartCoroutine(LoadTargetSceneWithDelay());

Not sure if this is your specific issue, but I’ve had it happen in the past to me when I was learning.

If your TimeScale is set to 0 that coroutine won’t do anything, since WaitForSeconds needs a TimeScale > 0. So if this is the problem you can set the TimeScale back to 1 or use WaitForSecondsRealtime which doesn’t need TimeScale, from my understanding.