I need some help please whit NumberWizardUI

Hello again! I have a problem whit this
Assets\Scripts\NumberWizard.cs(11,22): error CS0246: The type or namespace name ‘TextMeshProUGUI’ could not be found (are you missing a using directive or an assembly reference?)
and this
Assets\Scripts\NumberWizard.cs(4,7): error CS0246: The type or namespace name ‘TMpro’ could not be found (are you missing a using directive or an assembly reference?)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMpro;

public class NumberWizard : MonoBehaviour
{

[SerializeField] int max;
[SerializeField] int min;
[SerializeField] TextMeshProUGUI guessText;
int guess;

// Use this for initialization
void Start()
{
    StartGame();
}

void StartGame()
{
    max = max + 1;
    guess = (max + min) / 2;
}
public void OnPressHigher()
{
    min = guess;
    NextGuess(); 
}
public void OnPressLower()
{
    max = guess;
    NextGuess();
}

void NextGuess()
{
    guess = (max + min) / 2;

}

}

The error mentioned a namespace. Can you check your ‘using’ statements at the top of the code?

See if TMPro is spelled correctly?

It looks like you need a capital ‘p’ in ‘TMPro’

yes it is
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMpro;

Are you sure?

My mistake. Thanks for the help! Wish you have a nice day or night idk :smiley:

1 Like

Rock on dude!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms