- Home /
My button doesn't show the functions I want.
Hi, I'm new to Unity and I'm doing my school project in Unity, but I don't know anything.
I've been watching tutorials of the things I'm making and at this point I have a problem, I want to change the scene by clicking a button, I have the button with an image and all the options.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Cambio : MonoBehaviour
{
public void LoadScene (string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}
I've followed the tutorial of the script and everything ok but then when I put the game object with the script in the button, I have only 3 functions: GameObject, Transform and Change. But in the tutorial, the person has the function: ChangeSceneWithButton with LoadScene (string) on it, I have followed all the steps correctly but I don't know where the problem is.
My Unity version is Unity 2020.3.1f1
If you can help I thank you a lot, I'm very stuck at this point and have been searching for solutions for more than an hour. ^^
Here are some photos of the options and the GameObject I've used, the script inside the game object is the one I've texted about. Thanks.
Answer by Tymus · Jul 16, 2021 at 08:01 AM
Do you have any error in the console that would stop Unity from compiling ? I don't think there's an error in your script here.
You save your code? i dont see any errors in your script
Yes, I have saved all. May I change the script for another one? I don't know what to do.
Your answer
