UI buttons won't recognize script
So, I've been doing this select character script for the past day, and I have everything set up. Although, the button "On Click" menu wont recognize the script. It recognizes the image, and recognizes the initial script, but none of the voids. Is there any fix? Here's the code
using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; public class SelectCharacter : MonoBehaviour { public GameObject Cody; public GameObject CodyText; public GameObject Alvor; public GameObject AlvorText; public GameObject Back1; public GameObject Back2; // Back 1 is to go back Title Screen // Back 2 is to go back to Character Selection public Text AlvorSkillText; public Text CodySkillText; // Alvor Skill Text displays alvors skills, strengths and weaknesses // Cody Skill Text displays CODYS skills, strengths and weaknesses void Start(){ CodySkillText.enabled = false; Alvor.gameObject.SetActive (true); AlvorSkillText.enabled = false; AlvorText.gameObject.SetActive (true); Back2.gameObject.SetActive (false); Back1.gameObject.SetActive(true); Cody.gameObject.SetActive (true); CodyText.gameObject.SetActive (true); } public void OnCODYClick1(PointerEventData eventData) { CodySkillText.enabled = true; Alvor.gameObject.SetActive (false); AlvorSkillText.enabled = false; AlvorText.gameObject.SetActive (false); Back2.gameObject.SetActive (true); Back1.gameObject.SetActive(false); Cody.gameObject.SetActive (true); CodyText.gameObject.SetActive (true); } public void OnALVORClick1(PointerEventData eventData) { CodySkillText.enabled = false; Alvor.gameObject.SetActive (true); AlvorSkillText.enabled = true; AlvorText.gameObject.SetActive (true); Back2.gameObject.SetActive (true); Back1.gameObject.SetActive(false); Cody.gameObject.SetActive (false); CodyText.gameObject.SetActive (false); } public void OnCODYClick2(PointerEventData eventData) { SceneManager.LoadScene ("LEAVE_BLANK_UNTIL_FURTHER_NOTICE"); } public void OnALVORClick2(PointerEventData eventData) { SceneManager.LoadScene ("LEAVE_BLANK_UNTIL_FURTHER_NOTICE"); } public void OnBACKClick(PointerEventData eventData) // Back 2! { CodySkillText.enabled = false; Alvor.gameObject.SetActive (true); AlvorSkillText.enabled = false; AlvorText.gameObject.SetActive (true); Back2.gameObject.SetActive (false); Back1.gameObject.SetActive (true); Cody.gameObject.SetActive (true); CodyText.gameObject.SetActive (true); } public void OnBACK1Click(PointerEventData eventData) { // BACK 1! SceneManager.LoadScene ("TitleScreen"); } }