Here’s my code:
When I call the Move() function, I get this error:
System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x00083] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Single.Parse (System.String s) [0x0000b] in <695d1cc93cca45069c528c15c9fdd749>:0
at OnClickRobot.Move () [0x00020] in D:\Educational Game\Educational GAme\Assets\Scripts\OnClickRobot.cs:75
UnityEngine.Debug:LogError (object)
OnClickRobot:Move () (at Assets/Scripts/OnClickRobot.cs:83)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
But as you can see from when I log the texts, they should be valid, parsable strings…?
What is going on here?