Hello guys,
Im getting an error that says “Scene Manager does not contain a definition for Reload Scene”.
i tried switching the value from 0 to “Level 1” but it doesnt help.
public class CrashDetector : MonoBehaviour
{
[SerializeField] float loadDelay = 1f;
void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == "Ground")
{
Invoke("ReloadScene", loadDelay);
}
}
void ReloadScene()
{
SceneManager.ReloadScene(0);
}
}