i had created an empty gameobject and attached this script to it then put the gameobject into the button’s ONCLICK and then choosen the public function of the script
then when i play the the game the button dont work i dont understand why
i have only one scene and when the players die the button be activated 'i have done this in onother script"
i click the button to restart the scene…
this is he script:
using UnityEngine.SceneManagement;
using UnityEngine;
From what I see in images, you havn’t attached the script to a gameobject and you directly draged it from Project panel into the event slot in inspector (tell me if I’m wrong).
you need to drag the script on a gameobject and drag that gameobject into the slot in the event part of the button