I use timeline for creating an opening cutscene and I want to load the first level after the cutscene ends. So, I decided to use timeline signals. I created a signal emitter at the end of the cutscene and added LoadGamePlay
script to the signal receiver component. The problem is that the function doesn't show up in the dropdown menu. I can just select "string name" and write the scene name in the inspector. But this doesn't help so level 1 cannot be loaded. I'm not sure what I'm doing wrong.
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadGamePlay : MonoBehaviour
{
public string myScene = "";
public void LoadLevel()
{
SceneManager.LoadScene(myScene);
}
}
static
in their declaration) unless you have a reference to an instance of the component, not the script that defines the class. \$\endgroup\$