Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Why is this not working all of the sudden?

Discussion in 'Editor & General Support' started by RuneShiStorm, Jun 6, 2022.

  1. RuneShiStorm

    RuneShiStorm

    Joined:
    Apr 28, 2017
    Posts:
    264
    Hi!
    This Splash Script has worked throughout the entire development of this game, both the PC and Switch build, and today it decided not to work anymore... Why is that? I didnt update Unity or anything...


    Code (csharp):
    1.  
    2.  
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using UnityEngine;
    6. using UnityEngine.SceneManagement;
    7. public class SplashSequence : MonoBehaviour
    8. {
    9.     void Start ()
    10.     {
    11.       StartCoroutine (ToSplashTwo());
    12.     }
    13.     IEnumerator ToSplashTwo()
    14.     {
    15.         yield return new WaitForSeconds(2f);
    16.         LoadNextScene();
    17.     }
    18.     public void LoadNextScene()
    19.     {
    20.         SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    21.     }
    22. }
    23.  
    24.  
    Does it look wrong or why won't it work?
    Thanks in advance!
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    You need to explain what you mean by it "not working". What is it supposed to do, and what is it doing instead?
     
    CodeSmile and Kurt-Dekker like this.
  3. RuneShiStorm

    RuneShiStorm

    Joined:
    Apr 28, 2017
    Posts:
    264
    ah sorry... Its suppose to bring me to the next scene after 2 Sec.. But it just freeze on the first Spash Screen... S:
     
  4. RuneShiStorm

    RuneShiStorm

    Joined:
    Apr 28, 2017
    Posts:
    264
    Edit... Restarted the PC and now it works again... Very spoooky :S