Is it just me or is my button not working?

Okay, this is kind of a repost of a previous thread except I’ve replicated the bug I was experiencing. So, I’m making an idle clicker rpg and I needed to switch to new scenes when clicking the screen. I watched a tutorial on writing a code for such a thing and learned to load a scene on index using a button press. Since the game is for mobile, the entire screen would act as a button in these circumstances so I stretched a button over the canvas. I inserted the code as a component and set the button to use the code to load a scene on index. I was feeling lazy and just disabled the image and text parts of the standard Unity UI button and started up the game. Sadly, the button never did anything in game. I looked over everything multiple times and set the button back to its default state and tried it again. To my amazement, the button worked but I didn’t want to see the button so I disabled the text and image features again and tested it; the button went back to being useless. I was confused and upset at the time and thought about what I could do and decided to try enabling the image and text features but removing the image and deleting the text. This solution worked. I then wanted to experiment with different combinations of enabled and disabled button features that might work. I found that only the text portion of the button need to be enabled in order for the button to function. I just wanted to know if anyone else has had similar problems with actual unity elements not working properly when using script commands. I will link the code I used in the thread if anyone wants to test it themselves. I believe it came from the live training video posted by unity in 2016, but I can’t be too sure.

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

public class StartSceneOnClick : MonoBehaviour {

    public void LoadByIndex (int SceneIndex)
    {
        SceneManager.LoadScene (SceneIndex);
    }
}

Once again you provided anything EXCEPT the piece of code related to the problem and didn’t even mention your unity version.

As I said before, I tested this before, and the button does not behave the way you described on the 2019.2.

Make a blank scene to demonstrate the issue, export it as a package, upload it and perhaps someone will take a look at it.

I have the current version of Unity. I can try to provide a blank project with this as an example, but this is more in the vein of seeing if anyone else has had a unity engine element not work properly when using a custom script. I shall upload a file shortly with a demonstration

Here’s a package including 2 scenes and the line of code that was used. It was built in 2019.3 so I don’t know if the error happens in 2019.2 but I have tested that this is glitching appropriately when the text is disabled on the button.

5675632–591721–Button Test.unitypackage (5.04 KB)