Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

I am trying to make a game menu and access levels using a Parse method array, but I keep getting the following;

$
0
0
FormatException: Input string was not in the correct format System.Int32.Parse (System.String s) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629) Here is my code; using System.Collections; using System.Collections.Generic; using UnityEngine; public class PuzzleSelectController : MonoBehaviour { public void SelectPuzzle() { string[] name = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name.Split(); int index = int.Parse (name [1]); Debug.Log("Number " + index); // Application.LoadLevel("Gameplay"); } public void BackToMainMenu() { Application.LoadLevel ("MainMenu"); } } A lot of thanks to anyone. Fairly new to this situation.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>