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;
}