I haven’t messed around too much with the iphone unity, but a major road block is that after importing a project from the regular unity, it tells me that all my variables aren’t a member of UnityEngine.Components.
these are all my own variables, not ones from any of the script reference. I’ve gotten this error all the time before, but never with my own variables.
I knew it would take some work to transfer my project to the iphone, but can someone help me figure out this problem so I can start moving forward?
-Thanks
There is no problem.
Your code was just not written with the iphone in mind (basically #pragma strict).
On the iphone there is no dynamic typing, so if a function returns a Component like GetComponent() you either have to cast it to the appropriate class or you need to assign it to a variable thats declared of the appropriate class to work.
There are a good 2 dozen threads on it with indepth informations and examples on how to do both of them 
thanks, but after looking around, i still haven’t been able to figure out how to access variables from one script to another.
someObject.GetComponent(someScript).someVariable doesn’t work
i think i understand how GetComponent returns a component, but how do i get variables from that component?
(someObject.GetComponent(someScript) as someScript).someVariable
–Eric
wow, that’s really simple. I dont really get why the iphone makes that necessary, but oh well.
I got a lot of getcomponents to fix, but i think i got it. Thanks!
Because there isn’t any dynamic typing in Unity iPhone, and GetComponent only returns a Component. “.someVariable” is not a member of Component…if you use dynamic typing in regular Unity, it will figure out the type on the fly, but that is of course rather slow. So you have to tell Unity that you want the component to be cast as “SomeScript”, since “.someVariable” is a member of SomeScript.
–Eric