Files
blackhole-escape/Assets/Assets_And_Scenes/Scripts/Other Scripts/RestartLevel.cs
2022-06-18 15:55:39 +01:00

18 lines
408 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class RestartLevel : MonoBehaviour
{
void Update()
{
if (gameObject.name==("Player")) // need to get this to work when the player dies
{
Scene scene = SceneManager.GetActiveScene();
SceneManager.LoadScene(scene.name);
}
}
}