Death Menu doesnt work

I coded a script, that loads the “Death” scene, after I collide with the enemy, but when I switch to the “Death”
Scene after colliding, i cant do anything in that scene and i have no cursor. Has anyone got a solution?
This is my script to load the next scene:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class FinishScript : MonoBehaviour {
void OnTriggerEnter(Collider col)
{
if (col.gameObject.name == "Enemy")
{
    SceneManager.LoadScene("Death");
   
}
}
}

What is inside your death scene? It is better to show some game object instead of new scene on LoadScene() are all objects from old scene destroyed.

I dont know if you mean this but the things that are in my Death scene are:Main Camera,Directional Light, Canvas, Retry Button and EventSystem

could you please tell me how i show a gameobject or do you know any good tutorials about that topic.Sorry for my bad engish

There is tons of ways how you can do it you can for example set game object scale to 0,0,0 and then on trigger enter set it to 1,1,1 Just paste this into oyur script and call , FYI you can do this with any game component you want if you will edit it in same way, that is what are methods for

ShowUI(yourGameObjectName); or HideUI etc…

   static void HideUI(GameObject name)
        {
            name.transform.localScale = new Vector3(0, 0, 0);
        }
        static void ShowUI(GameObject name)
        {
            name.transform.localScale = new Vector3(1, 1, 1);
        }

This is simmilar but he not spawning death scene but pickup health.

I would not do this… if you have any UI objects that implement Layout objects, they may suddenly get divide by zero values as they try to reposition and they may not restore themselves properly with scale (1,1,1).

In particular, a zero-Z scale will cause TextMeshPRO objects to completely lose their minds.

Just turn it off with .SetActive() on the root object already.

And how you do if inside ui will be constantly updating value but you want see it only sometimes?Local scale is working good for me, what otner option then set active you recomand?? Only check != null for that go help?

Why constantly update it when its invisible? Just unsubscribe from listeners in OnDisable() and resubscribe in OnEnable()… that’s how my entire Datasacks module works and it is extremely performant and slick. The instant something is re-enabled, it resubscribes and updates itself.

Either way, due to the inherited nature of scale and cascading transforms, as well as the TextMeshPRO calculations and Layout object reorganization calculations, changing the scale to zero is not a generally viable solution. It might work for a while but you use it at your peril, as it is subject to well-defined future malfunctions.

That is good idea, do you think this will also work?Just simple example…

void Update() 

if(textGO !=null)
{
textGO.GetComponent<Text>() = someVariable.ToString();
}

My entire UI was in Update methid then i changed to Courutine and looks like i will go for OnDisable thing now i had no idea something like this exists.