I’m working on a puzzle game, and whenever I complete a level I do an animation which fades in a “LEvel Complete!” Screen. Then when the next scene loads, I run an animation that makes the “Level Complete!” screen fade out. But when I reload the same scene, it also plays the animation that fades out. Is there any way to make the animation not play when I reload?
Heres the Reload Level code:
using UnityEngine;
using UnityEngine.SceneManagement;
public class RestartLevel : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(KeyCode.R))
{
ResetCurrentScene();
}
}
void ResetCurrentScene()
{
Debug.Log("Scene Loaded");
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
Oh and btw, if you want more detail about my question, I followed a tutorial by Brackeys on transitions.