I am trying to use JSONObject with Unity JS, but I am running into an interesting problem where I cannot convert the values explicitly into strings (for eventually conversion to float in parseFloat).
var str = [insert json here] var j= new JSONObject(str); Debug.Log(j[0]["key"]); // outputs the right value! var d:String = j[0]["key"] as String; Debug.Log(d); // outputs null !! // resulting parseFloat yields error: ArgumentNullException: Argument cannot be null.
Not sure what’s going on here, but I guess the typecasting is failing and nullifying the data? How do you convert this data to a usable format?