So i have made a simple code that on click of a button will load a scene in unity, wait for 5 seconds and then switch to another scene. But while it firstly will load a scene, it won't load the second one. If anyone knows what am I doing wrong since I am a huge beginner in unity and coding, please help. <3
public void PickLockClick()
{
StartCoroutine(PickLockScene());
}
IEnumerator PickLockScene()
{
SceneManager.LoadScene(2);
yield return new WaitForSeconds(5);
SceneManager.LoadScene(3);
}