- Home /
Reference from another script Help?
Hey Guys i would like to ask if this is possible. I have created a script which contains a boolean check box. this boolean is activated when i step on a object if the player steps on the box it will tick the check box in the inspector mode. If he dose not step on the the box the check box will remain false. Now i would like to create another script that can check to see if the check box is enabled or disabled the reason for this is simple i want something to happen when the script reads that the check box is enabled from the previous script please help me out thank you in advance :)
here is my first script:
var ActiveBox : GameObject;
var AchivmentYesNo: GUITexture;
var FounAchievement: GUITexture;
var YesNo : boolean = false;
function OnControllerColliderHit (hit : ControllerColliderHit){
if(hit.gameObject.tag == "AchivActive" ){
Destroy(ActiveBox);
YesNo = true;
print ("Got Achivment");
FounAchievement.enabled = true;
yield WaitForSeconds(2);
AchievementYesNo.enabled = false;
FounAchievement.enabled = false;
//Destroy(this);
} } /* function ActiveAchievement (){
if (YesNo == true){
print ("Got Achievement");
FounAchievement.enabled = true;
yield WaitForSeconds(2);
AchievementYesNo.enabled = false;
FounAchievement.enabled = false;
} }
im not to sure on this can i use the
GetComponent();
command ?
The formatting here needs an edit $$anonymous$$C HALO, if you would be so kind, or someone with crazy rep and permission to edit
Yea sorry about that lol Proclyon But SirVictory gave me the answer i was looking for thanks :)
Answer by SrBilyon · Nov 19, 2010 at 10:39 AM
This answer will help you: http://answers.unity3d.com/questions/6997/setting-references-inspector
You know what i can not thank you enough i really appreciate for all the help you have given me thank you :)))