Why don't I go to the next question when I press answer?

When I press the button to answer the question, but don’t go to the next question, where’s what? Is there anyone who can help me?

This is the code of ImageAnswerButtons

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ImageAnswerButtons : MonoBehaviour
{
    public GameObject answerAbackGreen; // Green is Correct;
    public GameObject answerAbackRed; // Red is Wrong

    public GameObject answerBbackGreen; // Green is Correct;
    public GameObject answerBbackRed; // Red is Wrong

    public GameObject answerCbackGreen; // Green is Correct;
    public GameObject answerCbackRed; // Red is Wrong

    public GameObject answerDbackGreen; // Green is Correct;
    public GameObject answerDbackRed; // Red is Wrong

    public GameObject answerA;
    public GameObject answerB;
    public GameObject answerC;
    public GameObject answerD;

    public AudioSource correctFx;
    public AudioSource wrongFx;

    public GameObject currentScore;
    public int scoreValue;

    void Update()
    {
        currentScore.GetComponent<TMPro.TMP_Text>().text = "SCORE: " + scoreValue;
    }

    public void AnswerA()
    {
        if (ImageQuestionGenerate.actualAnswer == "A")
        {
            answerAbackGreen.SetActive(true);
            correctFx.Play();
            scoreValue += 1;
        }
        else
        {
            answerAbackRed.SetActive(true);
            wrongFx.Play();
        }
        answerA.GetComponent<Button>().enabled = false;
        answerB.GetComponent<Button>().enabled = false;
        answerC.GetComponent<Button>().enabled = false;
        answerD.GetComponent<Button>().enabled = false;
        StartCoroutine(NextQuestion());
    }

    public void AnswerB()
    {
        if (ImageQuestionGenerate.actualAnswer == "B")
        {
            answerBbackGreen.SetActive(true);
            correctFx.Play();
            scoreValue += 1;
        }
        else
        {
            answerBbackRed.SetActive(true);
            wrongFx.Play();
        }
        answerA.GetComponent<Button>().enabled = false;
        answerB.GetComponent<Button>().enabled = false;
        answerC.GetComponent<Button>().enabled = false;
        answerD.GetComponent<Button>().enabled = false;
        StartCoroutine(NextQuestion());
    }

    public void AnswerC()
    {
        if (ImageQuestionGenerate.actualAnswer == "C")
        {
            answerCbackGreen.SetActive(true);
            correctFx.Play();
        }
        else
        {
            answerCbackRed.SetActive(true);
            wrongFx.Play();
        }
        answerA.GetComponent<Button>().enabled = false;
        answerB.GetComponent<Button>().enabled = false;
        answerC.GetComponent<Button>().enabled = false;
        answerD.GetComponent<Button>().enabled = false;
        StartCoroutine(NextQuestion());
    }

    public void AnswerD()
    {
        if (ImageQuestionGenerate.actualAnswer == "D")
        {
            answerDbackGreen.SetActive(true);
            correctFx.Play();
            scoreValue += 1;
        }
        else
        {
            answerDbackRed.SetActive(true);
            wrongFx.Play();
        }
        answerA.GetComponent<Button>().enabled = false;
        answerB.GetComponent<Button>().enabled = false;
        answerC.GetComponent<Button>().enabled = false;
        answerD.GetComponent<Button>().enabled = false;
        StartCoroutine(NextQuestion());
    }

    IEnumerator NextQuestion()
    {
        yield return new WaitForSeconds(2);

        answerAbackGreen.SetActive(false);
        answerBbackGreen.SetActive(false);
        answerCbackGreen.SetActive(false);
        answerDbackGreen.SetActive(false);
        answerAbackRed.SetActive(false);
        answerBbackRed.SetActive(false);
        answerCbackRed.SetActive(false);
        answerDbackRed.SetActive(false);    
        answerA.GetComponent<Button>().enabled = true;
        answerB.GetComponent<Button>().enabled = true;
        answerC.GetComponent<Button>().enabled = true;
        answerD.GetComponent<Button>().enabled = true;
        ImageQuestionGenerate.displayingQuestion = false;
        
    }
}

This is the code of ImageQuestionGenerate

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class ImageQuestionGenerate : MonoBehaviour
{
    public static string actualAnswer;
    public static bool displayingQuestion = false;
    public int questionNumber;

    public ImageDisplay imageDisplay;

    // ประกาศตัวแปรสำหรับเก็บคำถามแบบทายภาพและตัวเลือก
    public Sprite questionSprite1;
    public Sprite questionSprite2;
    public string answerA1;
    public string answerB1;
    public string answerC1;
    public string answerD1;
    public string answerA2;
    public string answerB2;
    public string answerC2;
    public string answerD2;


    void Update()
    {
        if(displayingQuestion == false)
        {
            displayingQuestion = true;
            questionNumber = Random.Range(1, 3);

            if (questionNumber == 1)
            { 
                // ใช้คำถามและตัวเลือกจากตัวแปรใหม่ที่ประกาศ
                ImageDisplay.newQuestionSprite = questionSprite1;
                ImageDisplay.newA = "ทดสอบ1";
                ImageDisplay.newB = "ทดสอบ2";
                ImageDisplay.newC = "ทดสอบ3";
                ImageDisplay.newD = "ทดสอบ4";
                actualAnswer = "A";
            }

            if (questionNumber == 2)
            { 
                // ใช้คำถามและตัวเลือกจากตัวแปรใหม่ที่ประกาศ
                ImageDisplay.newQuestionSprite = questionSprite2;
                ImageDisplay.newA = "ทดสอบ1";
                ImageDisplay.newB = "ทดสอบ2";
                ImageDisplay.newC = "ทดสอบ3";
                ImageDisplay.newD = "ทดสอบ4";
                actualAnswer = "D";
            }
           ImageDisplay.pleaseUpdate = false;
        }
    }
}

This is the code of ImageDisplay

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ImageDisplay : MonoBehaviour
{
    public ImageQuestionGenerate questionGenerate;
    public GameObject screenQuestion;
    public GameObject answerA;
    public GameObject answerB;
    public GameObject answerC;
    public GameObject answerD;
    public static Sprite newQuestionSprite; // แก้ไขเป็น Sprite สำหรับคำถามแบบทายภาพ
    public static string newA;
    public static string newB;
    public static string newC;
    public static string newD;
    public static bool pleaseUpdate = false;

    void Update()
    {
        if (pleaseUpdate == false) 
        {
            pleaseUpdate = true;
            StartCoroutine(PushTextOnScreen());
        }
    }

    IEnumerator PushTextOnScreen()
    {
        yield return new WaitForSeconds(0.25f);

        // เซ็ตภาพใน Image ของ GameObject screenQuestion
        screenQuestion.GetComponent<Image>().sprite = newQuestionSprite;
        answerA.GetComponent<TMPro.TMP_Text>().text = newA;
        answerB.GetComponent<TMPro.TMP_Text>().text = newB;
        answerC.GetComponent<TMPro.TMP_Text>().text = newC;
        answerD.GetComponent<TMPro.TMP_Text>().text = newD;
        
    }
}

And there’s also Assets\Scripts\Imagescripts\ImageDisplay.cs(50,35): error CS1061: ‘ImageQuestionGenerate’ does not contain a definition for ‘SomeMethod’ and no accessible extension method ‘SomeMethod’ accepting a first argument of type ‘ImageQuestionGenerate’ could be found (are you missing a using directive or an assembly reference?)

This is the screen I made.

Can you post a screen shot of the buttons and the inspector. I see a few things wrong with your code but would be good to see how you have things connected

I fixed your code a bit, try to avoid using the Update() and GetComponent() if you can

[RequireComponent(typeof(AudioSource))]
public class ImageAnswerButtons : MonoBehaviour
{
    //**Add the buttons to these**
    public Button answerAbackGreen; // Green is Correct;
    public Button answerAbackRed; // Red is Wrong

    public Button answerBbackGreen; // Green is Correct;
    public Button answerBbackRed; // Red is Wrong

    public Button answerCbackGreen; // Green is Correct;
    public Button answerCbackRed; // Red is Wrong

    public Button answerDbackGreen; // Green is Correct;
    public Button answerDbackRed; // Red is Wrong

    public Button answerA;
    public Button answerB;
    public Button answerC;
    public Button answerD;

    //**Add the audio files**
    public AudioClip correctFx;
    public AudioClip wrongFx;

    //**Add Text **
    public TMP_Text currentScore;
    public int scoreValue;
           
    private AudioSource audioSource;

    private void Start()
    {
        audioSource = GetComponent<AudioSource>();
        scoreValue = 0;
    }

    public void AnswerA()
    {
        CheckAnswer("A");
    }

    public void AnswerB()
    {
        CheckAnswer("B");
    }

    public void AnswerC()
    {
        CheckAnswer("C");
    }

    public void AnswerD()
    {
        CheckAnswer("D");
    }

    private void CheckAnswer(string selection)
    {
        string answer = ImageQuestionGenerate.Instance.actualAnswer;

        if(selection.Equals(answer))
        {
            if (answer.Equals("A"))
                answerDbackGreen.gameObject.SetActive(true);
            else if (answer.Equals("B"))
                answerBbackGreen.gameObject.SetActive(true);
            else if (answer.Equals("C"))
                answerCbackGreen.gameObject.SetActive(true);
            else
                answerDbackGreen.gameObject.SetActive(true);

            audioSource.PlayOneShot(correctFx);
            AddScore(1);

        }
        else
        {
            audioSource.PlayOneShot(wrongFx);

            if (selection.Equals("A"))
                answerDbackRed.gameObject.SetActive(true);
            else if (selection.Equals("B"))
                answerBbackRed.gameObject.SetActive(true);
            else if (selection.Equals("C"))
                answerCbackRed.gameObject.SetActive(true);
            else
                answerDbackRed.gameObject.SetActive(true);
        }

        StartCoroutine(NextQuestion());
    }

    public void AddScore(int value)
    {
        currentScore.text = $"SCORE: {scoreValue+=value}";
    }

    IEnumerator NextQuestion()
    {
        answerA.enabled = false;
        answerB.enabled = false;
        answerC.enabled = false;
        answerD.enabled = false;

        yield return new WaitForSeconds(2);

        answerAbackGreen.gameObject.SetActive(false);
        answerBbackGreen.gameObject.SetActive(false);
        answerCbackGreen.gameObject.SetActive(false);
        answerDbackGreen.gameObject.SetActive(false);
        answerAbackRed.gameObject.SetActive(false);
        answerBbackRed.gameObject.SetActive(false);
        answerCbackRed.gameObject.SetActive(false);
        answerDbackRed.gameObject.SetActive(false);
        answerA.enabled = true;
        answerB.enabled = true;
        answerC.enabled = true;
        answerD.enabled = true;

        ImageQuestionGenerate.Instance.UpdateQuestion();

    }
}

I put a singleton that is a static of the class so you can just call the Instance instead of the variables

public class ImageDisplay : MonoBehaviour
{
    public static ImageDisplay Instance;
    public ImageQuestionGenerate questionGenerate;
    public Image screenQuestion;
    public TMP_Text answerA;
    public TMP_Text answerB;
    public TMP_Text answerC;
    public TMP_Text answerD;
    public static Sprite newQuestionSprite; // แก้ไขเป็น Sprite สำหรับคำถามแบบทายภาพ
    public static string newA;
    public static string newB;
    public static string newC;
    public static string newD;
    public static bool pleaseUpdate = false;

    public void Awake()
    {
        Instance = this;
    }

    public void PleaseUpdate()
    { 
        StartCoroutine(PushTextOnScreen());       
    }

    IEnumerator PushTextOnScreen()
    {
        yield return new WaitForSeconds(0.25f);

        // เซ็ตภาพใน Image ของ GameObject screenQuestion
        screenQuestion.sprite = newQuestionSprite;
        answerA.text = newA;
        answerB.text = newB;
        answerC.text = newC;
        answerD.text = newD;

    }
}```

```public class ImageQuestionGenerate : MonoBehaviour
{
    public string actualAnswer;
    public bool displayingQuestion = false;
    public int questionNumber;

    public ImageDisplay imageDisplay;
    public static ImageQuestionGenerate Instance;
    // ประกาศตัวแปรสำหรับเก็บคำถามแบบทายภาพและตัวเลือก
    public Sprite questionSprite1;
    public Sprite questionSprite2;
    public string answerA1;
    public string answerB1;
    public string answerC1;
    public string answerD1;
    public string answerA2;
    public string answerB2;
    public string answerC2;
    public string answerD2;

    public void OnAwake()
    {
        Instance = this;
    }

    public void UpdateQuestion()
    {
        
            questionNumber = Random.Range(1, 3);

            if (questionNumber == 1)
            {
                // ใช้คำถามและตัวเลือกจากตัวแปรใหม่ที่ประกาศ
                ImageDisplay.newQuestionSprite = questionSprite1;
                ImageDisplay.newA = "ทดสอบ1";
                ImageDisplay.newB = "ทดสอบ2";
                ImageDisplay.newC = "ทดสอบ3";
                ImageDisplay.newD = "ทดสอบ4";
                actualAnswer = "A";
            }
            else if (questionNumber == 2)
            {
                // ใช้คำถามและตัวเลือกจากตัวแปรใหม่ที่ประกาศ
                ImageDisplay.newQuestionSprite = questionSprite2;
                ImageDisplay.newA = "ทดสอบ1";
                ImageDisplay.newB = "ทดสอบ2";
                ImageDisplay.newC = "ทดสอบ3";
                ImageDisplay.newD = "ทดสอบ4";
                actualAnswer = "D";
            }
            ImageDisplay.Instance.PleaseUpdate();
        
    }
}```