- Home /
Web Player to iOS?
Hi community
I am quite new to game developement and even programing. I have been working with unity with a misunderstanding that i could later on export it to any platform.(m mostly a video editor).
So, with that stupidity in mind, I finally created a chess game with java script. and now when i build into android there is 600+ error. mostly about operator being on the right side of a variable.
How do i correct this? and what language should i use for android? what abt iOS?
Please help me... Thanks in advance.
Answer by save · Oct 27, 2011 at 11:24 AM
It doesn't matter what language you use, it will compile towards the platform standard. Although you should use #pragma strict at the top of every script you ever write that should compile with the rest of your app (Editor-scripts excluded).
The different platforms have different inputs for instance, so you have to script towards their specific functionality.
A good place to start is the Unity Manual. There you can include or exclude information which is specific for PC/Mac, iPhone and Android.
Hi i will need more of your help. after i go through the error there are only 2 types of error. 1 is my variable placement. This is my line that is error:
if (Pos$$anonymous$$ov[i]>=0 && Pos$$anonymous$$ov[i]<=63){
this is the log:
Assets/PlayerScript.js(95,14): BCE0051: Operator '>=' cannot be used with a left hand side of type 'Object' and a right hand side of type 'int'.
what does this mean? how do i correct this?
The second problem is i cant seem to call for a class from other local scipt.
How do i correct these problem. its like i get the same line for 600 times thats only about "+" "-" "*" "/" placement problem.. I think there must be a trick.
Regards, Sothea.
How have you declared cordin and Pos$$anonymous$$ov and what is held by them? You must set the type when you declare the variable, for instance:
var Pos$$anonymous$$ov : float[];
Always put #pragma strict at the top of every script when developing towards iOS or Android. They can't handle dynamic scripting.
Answer by dasca_thea · Oct 28, 2011 at 03:22 AM
Hi, I have been going around the net with no luck. I'm going to ask for more of your help. after going through all the script, i see i have 2 problems. one is with the operator and one with not being able to call for class in other scripts.
first thing first, here is my script:
n=(PlayerScript.cordin[1]-o)/8;
And i got this error:
Assets/White piece/Touk.js(103,26): BCE0051: Operator '-' cannot be used with a left hand side of type 'Object' and a right hand side of type 'int'.
what do i do with this? And i think i know what i mean with my second problem.. m so desperate...