Unity Script Tutorial Problem (403114)

Hi
In your tutorial for Scripting (http://docwiki.unity3d.com/uploads/Main/Scripting%20Tutorial.pdf in section 6 (Accessing Components), I keep getting an error.

I apply the “Switch.js” script to my Spotlight as instructed. This script contains a GetComponent(Follow).target line to call on the target variable inside the Follow.js script.

However, when I apply the Switch.js to my Spotlight as instructed, Unity keeps giving me a "Switch.js: BCE0019: ‘target’ is not a member of ‘UnityEngine.Component’. I’ve checked my scripts dozens of times with no clue to the problem.

For reference, the code is as follows:

Follow.js

var target : Transform;

function Update () {
	
	transform.LookAt(target);
}

Switch.js

var switchToTarget : Transform ;

function Update () {
	if (Input.GetButtonDown("Jump"))
		GetComponent(Follow).target = switchToTarget;
}

Note that I’m doing this in Unity iPhone and have a feeling this is the reason why I’m getting an error. Any solution to this? Are there any script tutorials for iPhone?

Oh I found a solution in another post…

But for iphone noobs such as I, this is the change in the Switch.js file that i had to make:

(GetComponent(Follow) as Follow).target = switchToTarget;

Hence, add “as Follow)” to the end of the GetComponent(Follow)

Would somebody please explain WHY we need to be explicit when referring to components for iphone development only?