I was getting a VAR ARG bug related to these three lines of code:
var varname : float[];
varname = new int[12];
Then I brought varname into a text string as part of a concat: textDisplay.GetComponent(UI.Text).text = String.Concat("Variable Name :", varname[0]);
This worked fine in the editor, but caused the VAR ARG crash in iOS.
I fixed the discrepancy between the two vars, but then Unity gave me this message: IAssembly - UnityScript has an extra field 'varName' of type System.Int32[]' in the player and thus can't be serialized (expected 'othervarname' of type "System.Int32[]').
I needed to hide the text element, create a new GameObject reference in script and not use the variable that caused this - if any of these were still active it would cause a similar crash. In addition, if any of this was active, I would get (don't have the exact words) something about an incompatibility between Player and Editor.
This is all working now in game, but I would love to know how to fix it without this workaround. Any suggestions?
↧