I have global.kills which is a string "10", but I want to convert it to an int called theKills. (When I check the type with Debug.Log, global.kills returns as a "Single") I've tried this: int theKills = int.Parse(global.kills); Which results in the following error: The best overloaded method match for `int.Parse(string)' has some invalid arguments My google links are all purple but I cannot find a way to convert this. Any help really appreciated
Not 100% sure- when I try: Debug.Log (global.kills.GetType()); The result is: System.Single On Googling though I couldn't find information on "Single". When I just Debug global.kills the result is a number (The number of kills the player has gotten).
You might want to figure out why you got it as a float too, since you can't have a fraction of a kill, so why not int