Hello, I am currently working on my first game in unity.
I have made it so, that when your lose after x collisions, you are taken to a restart scene, where there is a restart button, which is supposed to bring you back to the actual game.
The way I did this was:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class RestartController : MonoBehaviour
{
public void RestartControl()
{
SceneManager.LoadScene (“SampleScene”);
}
}
I added this script to my restart button object and then dragged the button into the onclick event and fixed the stuff there.
When I have x collisions, I am being taken to the restarting scene, so that works. But when I click on the restart button, I quickly see the actual game scene, but then it immediately flashes back to the restarting scene.
Can anyone help me out please?
Thanks already!