Unity destroying its codeing languages?

Ever since 4.1 lots of unity coding techniques no longer work for example i had code from a long time ago:

var camera2d : Transform;

function OnTriggerEnter(coll:Collider){

  GetComponent("CameraFollow2D").enabled = false;

camera2d.transform.Translate(Vector3(0,10,0));

}

Now this no longer works because enabled is not a member of unity.engine.component i thought maybe i got it wrongs i checked the documentation copied there line of code same thing seriously what is going wrong here unity lots of code no longer works how does enabled not work with get component?

That’s nothing to do with 4.1. It’s always been the case that GetComponent(“string”) returns Component, plus it’s slower and more prone to typos, so you never want to use strings with GetComponent if you can help it. Just do GetComponent(CameraFollow2D). Ever since Unity 3.4, using GetComponent without strings returns the actual type, rather than Component.

–Eric