The button is clicked but doesn't do what it is supposed to.

I changed one of the buttons to images to see if it is clicked by having it color transition and it does so nothing is blocking them. But when they are clicked they don’t do the function Clicked() i have it selected inside the editor under the On Click()

Heres my code

public GameObject north;
public GameObject south;
public GameObject southE;
public GameObject southW;
public GameObject northE;
public GameObject northW;
public GameObject east;
public GameObject west;

public GameObject chosenOne;
public List<GameObject> orbDice;

    void Start()
    {
        //Adds the east,south,west,etc gameobjects to orbDice here but i cut it out
        StartCoroutine(Ticker());
    }

    IEnumerator Ticker()
	{
		yield return new WaitForSeconds(5);
		while (true)
		{
			OrbSelector();
			yield return new WaitForSeconds(3);
			if (chosenOne.GetComponent<SpriteRenderer>().sprite == raidBoss2)
				yield break;
			else if (chosenOne.GetComponent<SpriteRenderer>().sprite == raidBoss1)
			{
				OrbDeslect();
				yield return null;
			}
		}
	}

	void OrbSelector()
	{
		chosenOne = orbDice[Random.Range(0, orbDice.Count-1)];
		chosenOne.GetComponent<SpriteRenderer>().sprite = raidBoss1;
		chosenOne.GetComponent<Button>().interactable = true;
		if (orbDice.Count == 0)
			StopCoroutine(Ticker());
	}

	void OrbDeslect()
	{
		chosenOne.GetComponent<SpriteRenderer>().sprite = raidBoss0;
		chosenOne.GetComponent<Button>().interactable = false;
	}

	public void Click()  <---This doesn't happen when clicked
	{
		chosenOne.GetComponent<SpriteRenderer>().sprite = raidBoss2;
		orbDice.Remove(chosenOne);
		chosenOne.GetComponent<Button>().interactable = false;
	}

@Yoconn I think the problem is that you are using are using a regular transform instead of a Rect Transform component which is what you commonly use for UI buttons on the canvas. I may be wrong.

Are you familiar with the Canvas object and common UI components like Image, Button(obviously hehe :P), Text?

To help narrow down what’s going on, try logging in your ‘Click’ function.

public void Click() {
    Debug.Log("Button clicked!");
}

Does that print to the console when you click the button?

If it does, then you know your button’s wired up correctly, but the code inside your Click function isn’t doing what you expect.

If it doesn’t, then your button isn’t wired up to the Click function.