Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Button Not Working

Discussion in 'Immediate Mode GUI (IMGUI)' started by JackHack101, Feb 16, 2021.

  1. JackHack101


    Jan 4, 2020
    so ive looked online and havent found an answer and im trying to figure out how to click this button (either one but im focusing on the top one) and my curser wont open into a hand and give the "You can click this button" (idk if it does that normally on unity or not) i put raycasting on and i put interactable on and i just cant figure it out (Unless the code to switch scenes i found on github is outdated) the script that is supposed to run is
    using UnityEngine;
    using System.Collections;
    using UnityEngine.SceneManagement;

    //HOW TO USE::
    //make a new "C# Script" in the project tab and give it the name "SceneLoad"
    //open up the new script and paste the entire contents
    //attach the new script to your player object
    //Create a new GameObject, adding one of the Collider2D components
    //check the "is trigger" box for the collider settings

    public class SceneLoad : MonoBehaviour {

    void OnTriggerEnter2D(Collider2D other) {
    Debug.Log ("GOGOGOGO SCENE");
    SceneManager.LoadScene("PhysTest"); //load this scene... change SCENENAME to the name of the scene you want

    So that might just not work but idk if anyone can help that would be nice ( :