Error Input string was not in a correct format.

Hello! My code is responsible for clicks, I click on a button and a cross or zero (tic-tac-toe) appears in this place, but I get an error:

FormatException: Input string was not in a correct format.
System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at <1f66344f2f89470293d8b67d71308c07>:0)
System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <1f66344f2f89470293d8b67d71308c07>:0)
System.Int32.Parse (System.String s) (at <1f66344f2f89470293d8b67d71308c07>:0)
ClickLogicMedium6x6.OnMouseDown () (at Assets/Scripts/XO/ClickLogicMedium6x6.cs:19)
UnityEngine.SendMouseEvents: DoSendMouseEvents(Int32)

Код

Note that you posted a Scripting question on the Unity Hub forum. The Unity Hub forum is unsurprisingly about the Unity Hub itself.

I’ll move your post to the scripting forum for you and remove the pointless poll.

Finally, here’s how to post code on the forums: Using code tags properly

When you call int.Parse(someString) it expects that someString should be something that can be converted to an int. So, whatever name is, it needs to be able to become an int. If it can’t, you get that error. While you could use TryParse before you try to use it, that may or may not solve your problem depending on how important it is that you actually get that int each time.