heres my script, im trying to make a scene transition:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneSwitcher : MonoBehaviour
{
public Animator Transition;
public GameObject Story;
public float TransitionTime = 1f;
void Start()
{
Time.timeScale = 1f;
}
public void Back()
{
SceneManager.LoadScene(0);
}
public void Levelone()
{
SceneManager.LoadScene(2);
}
public void QuitGame()
{
Debug.Log("QUIT!");
Application.Quit();
}
public void ActivateStory()
{
Story.SetActive(true);
}
public void QuitStory()
{
Story.SetActive(false);
}
public void LoadLevel()
{
StartCoroutine(LoadLevel(SceneManager.GetActiveScene().buildIndex + 1));
}
IEnumerator LoadLevel(int levelIndex)
{
Transition.SetTrigger("Start");
yeild return new WaitForSeconds(TransitionTime);
SceneManager.LoadScene(levelIndex);
}
}