[Canvas] EndgameMenu Button doesn't work

Hey, i have a problem in making the second button. The first button from main menu to the game itself work perfectly and i can play the level. But when the character dies and the endgame menu is enabled [with timescale 0 of course, end game is freezing the time] Then its just nothing happened with button for back to main menu. I’d checked the pointer event on eventsystem and the it doesn’t “sees” clicking on this button. and theres no highlights after i pointing it. Somebody know how to fix this? On the bottom i put some code for better view.

using UnityEngine;
using System.Collections;

public class StartGame : MonoBehaviour {

    public void ChangetoScene (int SceneToChangeTo) {
            Application.LoadLevel(SceneToChangeTo);       
        }
}
[...]
function Death ()
{
    // Set the death flag so this function won't be called again.
    isDead = true;

    // Turn off any remaining shooting effects.
    playerShooting.DisableEffects ();

    // Tell the animator that the player is dead.
    animation["die"].wrapMode = WrapMode.ClampForever;
    animation.Play("die");
   
   
    // Set the audiosource to play the death clip and play it (this will stop the hurt sound from playing).
    playerAudio.clip = deathClip;
    playerAudio.Play ();
    playerAudio.loop = false;
    yield WaitForSeconds(1f);

    // Turn off the movement and shooting scripts.
    PlayerMovement.enabled = false;
    playerShooting.enabled = false;
    Time.timeScale = 0.0;
    audiolistener.pause = true;
    GameOverMenu.active = true;
}

Screenshot:

I don’t exactly understand how this works as well, but I stumbled upon same problem and I did some tests. I had just a button to change the screen. It worked with timeScale being 1 but with timeScale being 0, it didn’t. So I thought about setting timeScale to 0, displaying the menu with animations that don’t depend on timeScale, then when you press the button set timeScale back to 1 and change the scene. I haven’t implemented it yet, but i’m thinking about doing it this way.

If you find a solution, please post it here, I’m interested as well.

Yeah i find the problem and its a unity bug. The exit button with scripts was placed under the “writing slot”, and what i saw there, it was circle halo on the exitbutton - probably for touch scripts. When this circle was near the writing box, the whole game and unity was crashed, but when i put the exit button on the corner of the screen it was playing good and nothing happens bad - just clearly load the main menu page when click on it.
Stupid idea but its a bug - or a feature :slight_smile: .