How would I go about adding a “R” button press to restart the 2D Rouge Like Tutorial game once your character dies.
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadScene : MonoBehaviour
{
private bool playerIsDead;
void Update(){
if (playerIsDead == true){
if (Input.GetKeyDown("KeyCode.R")){
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
}
}
Now you only have to set the bool playerIsDead to true if he dies.
Thank you I will certainly give that a try when I get home. Thank you for your input.