I’m trying to make an interactive random number generator, and I have two inputfields for the minimum and the maximum values. I know you can make a string to an int by doing int.Parse(variable), but if I do that Visual Studio gives me an error saying "Cannot implicitly convert type “int” to “UnityEngine.UI.Text”. Below is my code if it helps.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Controller : MonoBehaviour {
public Text randomMin;
public Text randomMax;
private void Start()
{
randomMin = int.Parse(randomMin.text);
randomMax = int.Parse(randomMax.text);
}
void updateMin (int Minimum)
{
randomMin = Minimum;
}
void updateMax (int Maximum)
{
randomMax = Maximum;
}
}