Newb ? again

hi all,

very basic question:

var PlayerScript;
var enabled : boolean;

function Update(){
    if(Input.GetKeyDown("g")){
		print("youpushed G");
		GetComponent.PlayerScript.enabled = false;   	
}
}

what I thought this would do is disable the script named “PlayerScript” when the G key is down. why oh why don’t it work? :slight_smile:
thanks!

d

It should be GetComponent(“PlayerScript”).enabled = false;

Actually it should be GetComponent(PlayerScript).enabled = false; Normally you don’t want to parse strings; it’s slower.

–Eric

thanks guys! much appreciated.