Hello,
I’m having trouble loading the second scene going through the portal in de first scene, even when I don’t have any save file.
Portal.cs :
private IEnumerator Transition()
{
if (sceneToLoad < 0)
{
Debug.LogError(“Scene to load not set.”);
yield break;
}
DontDestroyOnLoad(gameObject);
Fader fader = FindObjectOfType();
SavingWrapper savingWrapper = FindObjectOfType();
yield return fader.FadeOut(fadeOutTime);
savingWrapper.Save();
yield return SceneManager.LoadSceneAsync(sceneToLoad);
savingWrapper.Load();
Portal otherPortal = GetOtherPortal();
UpdatePlayer(otherPortal);
savingWrapper.Save();
yield return new WaitForSeconds(fadeWaitTime);
yield return fader.FadeIn(fadeInTime);
Destroy(gameObject);
}