Hi,
I am trying to build a game for iPad using unity 3 and getting various errors (screenshot attached below). Could someone please help me out in fixing these. I am using Unity Pro and iPhone advanced licenses. Thanks a lot for all your help.
You need to remove all dynamic typing. Put #pragma strict on your scripts so you get errors at compile-time instead of build-time.
–Eric
Hi,
I was developing with Unity 2.6 for 3 months, Today I got Unity 3 with iPhone and tried to build my project for iOS. I was running in the dynamic typecast trap, too. Now I simply can’t see, where the error is:
private var GloVa : variables;
GloVa = GameObject.Find("GlobalVariables").GetComponent(variables);
GlobalVariables is an empty GameObject with a Script attached named “variables”.
Unity gives me this error:
The name ‘variables’ does not denote a valid type (‘not found’). Did you mean ‘System.Runtime.InteropServices.ComTypes.VARFLAGS’?
You don’t have a script actually named “variables” (case matters), or else it’s not accessible for reasons such as being a C# script (in which case you need to put it in a folder that compiles earlier such as Standard Assets).
–Eric
I have this script. It is a javascript file and is in the folder “Scripts”. Do I have to move it to Standard Assets anyway?
I moved the script that throws errors to my script folder, which was in the standard assets befor. Now I get Unity telling me this:
Cannot convert ‘UnityEngine.Component’ to ‘variables’.
No…you do need to add “as variables” at the end after GetComponent(variables), although not having it wouldn’t result in the error you posted.
–Eric
Yes, I think, that’s it. I would never had find that out on my own.
Thanks a lot.
