Proud of myself!

I feel I’ve learned a ton, and this first challenge for making the next scene load automatically I was able to do without looking anything up! Usually I go back in the videos to reference stuff, but this time without skipping a beat I remembered right away to include Unity SceneManagement, and future proofed it so that it dynamically selects the next scene, in case I have the splash screen re-used between multiple levels or something. Here’s my code:

using UnityEngine;
using UnityEngine.SceneManagement;

public class SplashScreen : MonoBehaviour
{
    void Start()
    {
        Invoke("LoadNextScene", 5f);
    }

    private void LoadNextScene()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
}

I know it’s super simple and short, but I felt the class content really sticking and knew right away exactly what to do and how to do it. :slight_smile:

1 Like

Privacy & Terms