Issues with 3.3 to 3.4 javascript update

i use getComponent somewhat regularly and once upgraded to 3.4 everything seems to blow up. I did see the JavascriptGuide with the release notes but i’m havin issues figuring it out in this situation:

   var UnlockedLevelObject;//set up empty variable for a gameObject

function Start () {
	UnlockedLevelObject = GameObject.Find("LevelCarrier");//fill the empty variable with instantiated gameObject

	var LevelCarrierObject : LevelCarrier = UnlockedLevelObject.gameObject.GetComponent(LevelCarrier);//access variable in found gameObject above
	LevelCarrierObject.LevelToPlay = 0;//set variable insode that gameObject


You shouldn’t use untyped variables, such as “var UnlockedLevelObject;”. You should supply the type either explicitly or by using a value. (e.g., “var foo = 5;” is fine because it derives the type (int) by the fact that you supplied an int as a value.) In this case, the type should be GameObject.

You should specify whether you’re doing iOS/Android programming, because in that case, Unity 3.4 adds an invisible “#pragma strict” to all scripts. This doesn’t happen if you’re doing web/Mac/PC programming. So “this code doesn’t work in Unity 3.4” isn’t really true–in some cases it does, in some cases it doesn’t. (As an aside, you’ll find coding easier if you follow the convention of using lowercase for variable names, leaving uppercase for classes and functions.)