I used the code that comes with all games and attempted to modify it a bit so that way you could press a key with your fingers instead of using the mouse. This was because in my first person game the mouse would lock and when I unlocked it to press the reset GUI it would simply lock back on. So I did a little research and here is my code that does not currently work. Please help and thank you in advance.
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
public class LevelReset :MonoBehaviour , IPointerClickHandler
{
void Update()
where (Input.GetKeyDown(KeyCode.J))
{
// reload the scene
SceneManager.LoadScene(SceneManager.GetSceneAt(0).name);
}
private void Update()
{
}
}
change to this: