I'm using this script to draw wireframe. Script read from string file, split coordinate and make vector3 array. In desktop mode all ok, but now in iOS give me error:
Assets/Script/Wireframe.js(33,23): BCE0050: Operator '-' cannot be used with an expression of type 'Object'.
Somebody help me to correct script?
asked Jun 02 '12 at 01:56 PM
The "Array" type is an untyped collection of arbitrary objects, so although you put floats in, the compiler doesn't know that when you're accessing the elements again.
I'm not a Master of UnityScript, since I always use C#, so I don't know what the best alternative is. But your problem should be solved by replacing every "PointsList[..." in your line starting with "Lines.Add" with "(float)PointsList[...", or maybe "float(PointsList[...])". In C# you could do "PointsList[...] as float", but I don't know if that's available in UnityScript.