Hi, I made game with collectibles and after collect all of them on the screen we can see “you won” which is UI Text. I’d like to back to main menu after 3 seconds from this text. This UI Text is including all game scene. In my build settings main menu has number 2 - for easier make code for me. How then can I do it, with script I guess?

Easiest way to do it would be to attach a script to your text, and only activate your text’s GameObject when you show it, so that you can call the code to load the scene with the OnEnable callback. To wait for 3s, you need to use a Coroutine.

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

public class LoadScene : MonoBehaviour
{
    [SerializeField]
    private int m_SceneIndex = 2;

    [SerializeField]
    private float m_DelayBeforeLoad = 3f;

    private void OnEnable()
    {
        StartCoroutine(WaitAndLoadScene(m_SceneIndex, m_DelayBeforeLoad));
    }

    private IEnumerator WaitAndLoadScene(int sceneIndex, float delay)
    {
        yield return new WaitForSeconds(delay);
        SceneManager.LoadScene(sceneIndex);
    }
}

However, it would be better to write a public function that you would call right after showing the text, in which case you’d need to replace private void OnEnable() by public void Load().