Trying to add a simple point system to my game. I'm trying to drag my text on to the script, but it does not recognize it as a text. Is there something wrong with my code or something???

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

public class UI : MonoBehaviour

public Text PointsText;
public Text HighscoreText;

int Points = 0;
int Highscore = 0;

// Start is called before the first frame update
void Start()
    PointsText.text = Points.ToString() + " Points";
    HighscoreText.text = "Highscore: " + Highscore.ToString();

I had this problem as well. You can use legacy UI text, which works… I don’t know any better fix.