How to make a button appear on a condition?

So I have the words “You’ve won!” appear after the end of a little ball maze game(roll a ball but modified). I wanted to make a button pop up after it congratulates you that says “continue”, which allows me to go to a new scene(new level). When I tried to script this I tried to copy the if-then parts of the rest of the script, it says it is all right(doesn’t have a red line under it) except for the .gameComponent. I am very new to scripting so I wont be suprised when all of it is wrong and it just says this little part is. When I hover over the red underlined gameComponent its says that Player Controller cannot find the meaning enven though its obviously above. I have tried changing it to .gameObject there and at the top and still didn’t work. I have also Made sure that nothing is spelled wrong. But if it is all wrong pls give me the scripting to make this work!!! The middle separated part of the script where the first dot is, marks where I scripted myself and where the problem lays.
Here it is:

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

public class PlayerController : MonoBehaviour {

public float speed;
public float time = 0;
public Text countText;
public Text winText;
public Component continueBtn;

private Rigidbody rb;
private int count;
private Component countinueBtn;

void Start()
{
    rb = GetComponent<Rigidbody>();
    count = 0;
    SetCountText();
    winText.text = "";
}
void FixedUpdate()
{
    float moveHorizontal = Input.GetAxis("Horizontal");
    float moveVertical = Input.GetAxis("Vertical");

    Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);

    rb.AddForce(movement * speed);
}

void OnTriggerEnter(Collider other)
{

    if (other.gameObject.CompareTag("Pick Up"))
    {
        other.gameObject.SetActive(false);
        count = count + 1;
        SetCountText();
    }
  •  {
        if (count >= 18)
        {
            PlayerController.gameComponent("ContinueBtn").SetActive(true);
        }
        else
        {
            PlayerController.gameComponen("continueBtn").SetActive(false);
       }
    
  •  }
    

    }

    private void SetActive(bool v)
    {
    throw new NotImplementedException();
    }

    void SetCountText()
    {
    countText.text = "Count: " + count.ToString();
    if (count >= 18)
    winText.text = “You’ve won!”;
    }
    }

I’m not sure what you are doing with the gameComponent(“…”) thing, but a big error I saw off the bat is that you declare gameComponent twice, first as public then as private.

A better way to do what you are trying is to do

public GameObject buttonContinue;

either connect this in the unity editor or use button = GameObject.Find(“name of continue button”) in Start().

Once you have that, you can simply do

buttonContinue.SetActive(true); 

to make it appear or

buttonContinue.SetActive(false);

to hide it.

I’m not sure of the tutorial, but I think the best thing to do would be to make a Button gameObject, and attach it it in the inspector.

public GameObject continueButton;
void Start()
{
    continueButton.SetActive(false);
}

void OnTriggerEnter(Collider other)
{
    if (count >= 18)
        continueButton.SetActive(true);
}