- Home /
My game does not run when I switch to Android Platform
I have created a game with the p.c. platform. My game is running flawlessly, but when I switch my platform to Android it get lot of errors...
'GetComponent' is not a member of 'Object'.
for (var checkDoor : GameObject in cells[i].GetComponent(AIpathCellScript).doors)
'height' is not a member of 'UnityEngine.Collider'.
transform.position.y = playerCapsuleTransform.position.y + ((playerCapsuleTransform.GetComponent(Collider).height * playerCapsuleTransform.localScale.y) / 2) + (transform.localScale.y / 2) + floatAbove;
Operator '<' cannot be used with a left hand side of type 'Object' and a right hand side of type 'float'.
if (doorCheckingNow.GetComponent(AIpathDoorScript).doorsToCells[i] < shortestPathSoFar)
HELP ME..!!! xd
Comment
Answer by Graham-Dunnett · Nov 28, 2013 at 11:07 AM
Mobile builds need #pragma strict
as the first line of each of your scripts. If your scripts do not have this, then expect to have problems on mobiles. When you add this line to your code, you will probably find that you get compiler errors. You'll need to fix these errors before the game will run on the mobile.