As the title says im getting the “FormatException: Input string was not in a correct format.” error but other solutions aren’t. I have the code connected to an input field to get a string when done editing, and the input field is integer only. I don’t understand how it’s even possible for me to enter it in a way it can’t format.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IQManager : MonoBehaviour
{
//Declare Variables
public static int IQ;
public static int skilplus;
public void getIQ(string s)
{
//update variables
IQ = int.Parse(s);
//check if elligible for bonus
if (IQ > 15)
{
skilplus = IQ - 15;
}
//change text
Debug.Log(IQ);
Debug.Log(skilplus);
}
}