Answers for "unity int to text"

1

unity text display int

public Text text;
public int num;

void Update ()
{
  text.text = num.ToString();
}

//Make sure to set the text variable to a UI text inside Unity
//or run GetComponent<>() in the Start() or Awake() functions
Posted by: Guest on October-27-2020
1

how to make int to text unity

private void Start()
    {
        text = GetComponent<Text>();
    }
    private void Update()
    {
        text.text = theInt.ToString();
    }
Posted by: Guest on May-27-2021

Browse Popular Code Answers by Language