Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Fade Out Not Displaying - Brackeys Transition Tutorial

Hi

I am trying to get the fade out happening when my player reaches the end of the level.

The fade in works at the start, the Trigger works to fade out and the fade out appears to be playing in the Animator window, however nothing shows on screen.

If I make I swap the animations, the same thing happens with the level end animation.

Any help is appreciated.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.SceneManagement;


public class LevelExit : MonoBehaviour

{

  [SerializeField] float levelLoadDelay = 3f;

  public Animator transition;

 

  private void OnTriggerEnter2D(Collider2D collision)

  {

    StartCoroutine(LoadNextLevel());

  }


  IEnumerator LoadNextLevel()

  {

       

    transition.SetTrigger("Start");

    yield return new WaitForSecondsRealtime(levelLoadDelay);


    var currentSceneIndex = SceneManager.GetActiveScene().buildIndex;

    SceneManager.LoadScene(currentSceneIndex + 1); 

  }

}

Sign In or Register to comment.