Hello everyone!
I’m having a problem invoking loading a scene after an animation has played. The SceneManager.LoadScene(); function never seems to execute, and I can assure you that the game object isn’t being destroyed or disabled at any time
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public Animator CameraAnimation;
public Animator DoorAnimation;
public void Play()
{
CameraAnimation.CrossFade("PlayCameraTransition", 0.05f);
DoorAnimation.enabled = true;
DoorAnimation.Play("MenuDoorOpen");
Invoke("Load", 2);
}
private void Start()
{
DoorAnimation.enabled = false;
}
void Load()
{
SceneManager.LoadScene("Dungeon");
}
}
and P.S. Play() gets called from a button