i need help with my 3d button that is not an ui button

Help wanted so my problem is that i get error 1001 edentifier expected and this is my code can someon tell me the problem

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

public class lemer : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    
    }

    // Update is called once per frame
     private void OnMouseDown()
    {
        SceneManager.LoadScene("level 2").(gameObject);
    }
}

Line 17 doesn’t make sense. Everything from the second dot through the parenthesis should not be there.

SceneManager.LoadScene(2);

The above code loads the third scene, whatever that is.

I highly recommend NOT using the numbers for loading scenes: use the name of the scene instead, as a string.

The reason: if you change your scene ordering, this code will mysteriously break.

1 Like

thanks kurt-Dekker