Lection 38. Button Click Loads Scene. Run into problems

Lection 38. Button Click Loads Scene.
Hello. Can you help me?
When I click the button, next scene doesn’t load.
The program compiles correctly.
My code:

Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneLoader : MonoBehaviour
{
    public void LoadNextScene()
    {
        int currentSceneIndex = SceneManager.GetActiveScene().buildIndex; 
        SceneManager.LoadScene(currentSceneIndex + 1);
    }
}
Screenshot

Hi Outlaw,

Welcome to our community! :slight_smile:

Are there any error messages in your scene when you click on the button? Is there a “next scene” in File > Build Settings?

Hi Nina, I’m glad to be in your community)
When I copied the scenes, the first and second were absolutely the same, so I did not notice the difference in the transitions between the scenes. I apologize.

Does that mean the problem was no problem, and the topic/issue is obsolete? :slight_smile:

Yes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms