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 Matt 15 · Feb 13, 2011 at 11:16 PM · bug

Scripts still functioning even if UN-checked in editor?

Anyone else finding some strange bugs with unity 3.2? i searched the forums a bit and didn't find much...

My main "strange" occurrence is when I un-check a script on an object, but the script still runs. I'm running into other errors that "should" be working correctly, and I'm wondering if there are other buggy things that you guys might know about. any help is greatly appreciated!

function populateGrid() { for(i= 0; i < boxCount; i++){ identifier = Random.Range(0,4);

   switch(identifier){
     case(0):
     (asset0.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber = 0;
     myAsset = (Instantiate(asset0, Vector3(transform.position.x + xAdjust, transform.position.y + yAdjust, transform.position.z), transform.rotation) as GameObject);
     break;
 case(1):
     (asset1.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber = 1;
     myAsset = (Instantiate(asset1, Vector3(transform.position.x + xAdjust, transform.position.y + yAdjust, transform.position.z), transform.rotation) as GameObject);                   
     break;
 case(2):
     (asset2.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber = 2;
     myAsset = (Instantiate(asset2, Vector3(transform.position.x + xAdjust, transform.position.y + yAdjust, transform.position.z), transform.rotation) as GameObject);                   
     break;
 case(3):
     (asset3.GetComponent(touchingThreeScore) as touchingThreeScore).idNumber = 3;
     myAsset = (Instantiate(asset3, Vector3(transform.position.x + xAdjust, transform.position.y + yAdjust, transform.position.z), transform.rotation) as GameObject);                   
     break;

}

if(xAdjust < columns){ xAdjust += 1.1; }else{ xAdjust = 0.0; yAdjust -= 1.1; }

var touchingThreeScript2 : touchingThreeScore = (FindObjectOfType(touchingThreeScore) as touchingThreeScore); touchingThreeScript2.shouldPlay_tts = true;

}

Comment
Add comment · Show 3
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 Bunny83 · Feb 14, 2011 at 12:01 AM 4
Share

what is still running? If you disable a script, only Update, LateUpdate and FixedUpdate functions will be disabled. Other events should fire normally. What "other errors"? There is almost nothing "buggy" maybe you just don't know how it works. Please ask specific questions! Post your code if something don't work and explain what is not working. Please read the FAQ: http://answers.unity3d.com/faq

avatar image Matt 15 · Feb 14, 2011 at 04:04 AM 0
Share

I appologize for not giving more explicit information. The best i can describe is that my creator script, (which instantiates a bunch of cubes currently) still runs even if i UNcheck the box next to the game object who carries the script. I've added the script info to the original question.

avatar image Eric5h5 · Feb 14, 2011 at 05:53 AM 0
Share

This behavior is as described in the docs and is not buggy.

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by · Feb 14, 2011 at 05:38 AM

As Bunny83 says, the other functions will still work if they're specifically called.

You could add something like this to the top of your function:

if ( gameObject.active == false )
    return;
Comment
Add comment · Show 1 · 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 thunderFD · Apr 26, 2014 at 09:19 PM 0
Share

OH WOW.. thank's for this.. I am pretty new to unity and this confused me alot.

I am building a small 2D multiplayer tank shooter for fun with the photon cloud. I was really surprised when I realised that the OnTriggerEnter2D in one of my deactivated scripts was still being called. It took me some time to figure that out >.<

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

1 Person is following this question.

avatar image

Related Questions

2 Bugs in my game: mouse control takes some time to load and Menu not working. 0 Answers

Distance betwen two objects.Error,bug,etc. 2 Answers

Is there any flying bug scripts out there? 1 Answer

MonoDevelop doesn't open script and keeps restarting? 0 Answers

"Flickering" camera bug on each Unity startup 3 Answers


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