Question by
jretchford · May 15, 2020 at 01:37 PM ·
inputstringsystemformat
FormatException: Input string was not in the correct format System
Got this error in my console, and not quite sure on how to fix. Here's the code assigned to it.
{
public GameObject guiObject;
public GameObject bubble;
public GameObject playerHead;
public GameObject text;
void Start()
{
guiObject.SetActive(false);
bubble.SetActive(false);
text.SetActive(false);
playerHead.SetActive(false);
}
void OnTriggerStay2D(Collider2D other)
{
if (other.gameObject.tag == "Player")
{
guiObject.SetActive(true);
int num = int.Parse(FindObjectOfType<InventorySystem>().moneyDisplay.ToString());
if (num == 400 && guiObject.activeInHierarchy == true && Input.GetButtonDown("Use"))
{
SceneManager.LoadScene("EndScene");
guiObject.SetActive(false);
}
else
{
guiObject.SetActive(false);
bubble.SetActive(true);
text.SetActive(true);
playerHead.SetActive(true);
}
}
}
void OnTriggerExit2D()
{
guiObject.SetActive(false);
}
}
Comment
Your answer
Follow this Question
Related Questions
JSON value contains "instanceID" 0 Answers
inputString returns blank for non-char keys 0 Answers
Creating a main menu with the new input system 0 Answers