Sorry but why this script didn't working?

Sorry but why this script didn’t working?

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

public class Menu : MonoBehaviour
{
    void Start(){
     
    }

    void Update(){
     
    }

    // Voidy do guzików //
    void GrajBtn()
    {
        SceneManager.LoadScene(1)
    }
}

your method GrajBtn() is not called from anywhere, you could call it inside Start() to make it load scene then.

(also need to attach that script into some gameobject in scene, if not already)

1 Like

What are you expecting it to do then?
A shot in the dark: you never call GrajBtn(), so it is never executed and therefor the level is never loaded.

Fnx all

This line using UnityEngine.SceneManagement: is wrong. You have a : at the end of the line instead of a ;
using UnityEngine.SceneManagement;
Also this line SceneManager.LoadScene(1) is missing a ; from the end of it.

Both of the above are speculation as you haven’t given us any information on what is actually happening.

Before we thrash around too much more guessing, let me offer this to OP:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

How to understand compiler and other errors and even fix them yourself: