What is wrong with this Code? How can I use TMP_Text i do not understand this?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CoinManager : MonoBehaviour
{
public int geld;
public Text money;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
money.text = geld.ToString();
}
public void AddMoney()
{
geld++;
}
}
This is nothing to do with 2D. Please use the Scripting, Getting Started or the TextMeshPro forums for this kind of stuff. I’ll remove the 2D tag and move to the Scripting forum for you.