Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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
0
Question by 1918me · Aug 08, 2015 at 09:36 PM · script errorscriptingproblemscript loading

Scripts Won't Update?

I've been trying to debug a script I've been writing, and I just noticed that the edits I've made aren't being acknowledged when I test the game; even after commenting out the entire script, the old version still runs. Things I've tried so far include:

  1. Saving the script on Monodevelop before running the scene

  2. Re-importing the script

  3. In the project view, selecting "Sync Monodevelop Project"

  4. Restarting the editor

  5. Refreshing the script

  6. Restarting my computer

Also, when I select the script in the inspector, it shows the edits [I've] made (i.e. that everything's commented out), but those changes don't take effect in the game itself. I've never had this problem before, and I can't for the life of me figure out what's going on. Has anyone else experienced this, and if so, any ideas on how to fix it?

Update: Even when I remove the script from the object its attached to, it still runs. I'm now officially out of ideas.

Comment
Add comment · Show 6
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 Addyarb · Aug 09, 2015 at 12:00 AM 0
Share

Can you post the script? Perhaps you are expecting something to happen in a function that isn't being called, or something like that? This has indeed happened to me before at points, but usually restarting the editor fixes the issue(s).

avatar image 1918me · Aug 09, 2015 at 12:56 AM 0
Share

Well, that's the thing; it's not that my script isn't working as intended, it's that it's being run when I know nothing should be happening. Here's the code:

 public class SoundScript : $$anonymous$$onoBehaviour {
 
     public GameObject listener;
     List<Collider> heardPlayers = new List<Collider> ();
     List<Collider> knownColliders = new List<Collider> ();
     List<Collider> trueActives = new List<Collider> ();
     float checkTime = 0.0f;
     bool check = false;
 
         /*
         All the code here is commented
         */
 }

Yet, I'm getting printout statements that have been commented, etc. If I remove the public variables from the code, those changes are reflected in the editor, but in-game, the old code still runs, and I just get null reference exceptions. Even when I remove the script component from my object, it runs. The only thing I can think of is I just upgraded to Windows 10, and maybe something there is messing with Unity?

I'm not really sure what to do at this point.

avatar image YoungDeveloper · Aug 09, 2015 at 02:33 AM 0
Share

are you saving your script after making changes?

avatar image Addyarb · Aug 09, 2015 at 02:58 AM 1
Share

Sorry to hear you are having such a difficult time with this! I just upgraded as well but am not having any issues like this. If you search for the script in your documents and open it with notepad/another IDE does it look the same? It sounds like there's a disconnect between $$anonymous$$D and Unity. I suppose there is always reinstalling, just be sure and back up. Let me know if you're still having issues and I'll try to help. Also, perhaps try saving a copy of the script, and then pasting it into a new class after completely removing it from the project? Good luck!

avatar image 1918me · Aug 09, 2015 at 04:20 AM 0
Share

Yeah, I actually did open it in notepad, and it looked like it should, commented and all. Your new class idea worked, so as long as this doesn't keep happening, I should be good to go. Otherwise, I guess I'll just reinstall, but hopefully it won't come up again. Thanks for the help!

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Please. Help me out :( 1 Answer

Can't use any scripts at all (Just installed engine). 0 Answers

error CS1525: Unexpected symbol 'rigidbody' 1 Answer

Activate/Deactivate Scripts form another Script 2 Answers

Making a character jump and crouch using a Joystick 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