I was working on a code and got an issue. What I'm trying to do is to use InputField in unity, then use that number to multiply by existing float. Here's what I got so far:
private float finePrice = 0.0001f;
public InputField enterValue;
public Text estimatedValue;
estimatedValue.text = string.Format ("{0}", finePrice * enterValue);
Error I'm getting:
Operator `*' cannot be applied to operands of type `float' and `UnityEngine.UI.InputField'
In my understanding is that I cannot multiply string (inputfield) to float? I tried changing Content Type of Input Field to "Decimal Number" but I'm getting the same error. Tried googling it, nothing to be found. Please help? I'm lost.