Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by MC HALO · Nov 19, 2010 at 02:48 AM · getcomponentachievement

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 ?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Proclyon · Nov 19, 2010 at 12:03 PM 2
Share

The formatting here needs an edit $$anonymous$$C HALO, if you would be so kind, or someone with crazy rep and permission to edit

avatar image MC HALO · Nov 20, 2010 at 02:24 AM 1
Share

Yea sorry about that lol Proclyon But SirVictory gave me the answer i was looking for thanks :)

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by SrBilyon · Nov 19, 2010 at 10:39 AM

This answer will help you: http://answers.unity3d.com/questions/6997/setting-references-inspector

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image WaddleDuck · Nov 19, 2010 at 10:41 AM 1
Share

Ah, so thats how you do it! :O!

avatar image MC HALO · Nov 20, 2010 at 02:22 AM 1
Share

You know what i can not thank you enough i really appreciate for all the help you have given me thank you :)))

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

C# - Problem with trigger that won't activate 1 Answer

Any way to 'GetComponent' as a base class? 2 Answers

I Made a Revolver Script, But It's Saying There is an Error 2 Answers

Disable a GameObjects scripts knowing only the GameObjects name 3 Answers

Talking To Other Scripts 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges