I'm asking the player to type in numerical information in the uGui input field. Things like age and height.
Then I use the Convert String to Int Action. And I do different things based on the age and height.
However, when the player types non numerical information... like "DGF" and I use the Convert String to Int Action, I get an error.
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)
HutongGames.PlayMaker.Actions.ConvertStringToInt.DoConvertStringToInt () (at Assets/PlayMaker/Actions/ConvertStringToInt.cs:46)
HutongGames.PlayMaker.Actions.ConvertStringToInt.OnEnter () (at Assets/PlayMaker/Actions/ConvertStringToInt.cs:33)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2686)
HutongGames.PlayMaker.Fsm.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1920)
PlayMakerFSM.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:532)
The good news is the errors are only in my console and it dose not seem to crash the game in my limited testing. However, should I worry for extended play? This game will be left on for days (museum instillation).
Because I cannot control what the player types, I'm struggling how to solve this.
Is there a command that can help me, or an "Identify if String is an Int" Action?
Thank you kindly for your thoughts.