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
3
Question by Shoey · Jan 29, 2013 at 09:51 PM · updateresetautomatically

Scripts won't automatically update, always need to 'reset' them in the inspector for update

I'm running Unity v4.0.1 on Windows 7.

Is there any way to make my scripts automatically update when I save them in MonoDevelop?

They only seem to update in Unity when I either 'reset' them or move them to a different folder.

Thanks, Shoey

Comment
Add comment · Show 1
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 meat5000 ♦ · Sep 11, 2013 at 11:21 PM 0
Share

I got in to the habit of reloading my scene (remember to SAVE first)

11 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by Entevily · Aug 14, 2015 at 03:18 PM

I know this is a really old post. But I had this problem. To fix it, all I had to do was go into the Edit -> Preferences...

Once there, under the General Tab, I had to check the box for "Auto Refresh". That was it. When I save it now updates live in the game. I don't know why I ever unchecked that box. I hope this helps anyone who runs into this problem.

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 See_Sharp · Jul 06, 2016 at 11:27 AM 0
Share

Oh my. I reïnstalled unity about 3 times, and this solved it.

I was working on an editortool and apparently EditorPrefs.DeleteAll() caused this bug for me.

avatar image
2

Answer by Bunny83 · Jan 29, 2013 at 11:34 PM

The scripts will update unless you screwed up Unity in some way. However, how can you tell they don't update? If you mean setting new default values for public variables then yes, they won't change. The point of public variables is that you can change them in the inspector. If you initialize a variable in your script it will only use that value when the script-component is attached to an object or reset.

If you don't want to set them in the inspector, don't make them public like robertbu said. If you need them to be public to access them from another script but you don't want it to get serialized by unity, add the System.NonSerialized attribute to your variable.

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 atr0phy · Nov 12, 2014 at 07:56 AM 1
Share

@Bunny83

"The scripts will update unless you screwed up Unity in some way."

Sorry but that is such a cop-out response. You automatically assume that Unity itself isn't the culprit, as if it's invulnerable to its own bugs. This problem has been happening with me, and others, as well. Code compiles fine, but (randomly) Unity doesn't acknowledge the newest version of a script, as if it's using a cached version.

Same problem has been raised here: http://answers.unity3d.com/questions/687519/scripts-compiling-but-not-updating.html

avatar image
2

Answer by mx442 · Apr 02, 2013 at 06:15 PM

I was having the same problem, right-clicking in the project window and selecting "Sync Mono Develop Project" fixed it for me. I hope it helps.

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 MutualTeats · Aug 13, 2013 at 08:17 AM 0
Share

Only workes once for me, I'll have to click "sync mono dev. project" every time I want to sync a script. It's really not that big of a deal, but it's very frustrating when you forget to click it and think there is something worng with the code.

avatar image
1

Answer by robertbu · Jan 29, 2013 at 11:12 PM

Assuming you don't want them to show up in the inspector, you can make your variables private.

 private int iVal; // C#
 private var iVal : int; // Javascript

Variables in C# are private by default, but in Javascript they are public by default.

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 sosh · Nov 17, 2014 at 01:20 PM 0
Share

But shouldn't a change to the value in the code editor be reflected in the unity editor?

avatar image
1

Answer by gamer2300 · Sep 11, 2013 at 11:17 PM

I have same problem i dont find right-clicking in the project window and selecting "Sync Mono Develop Project" but i click on reset on panel opf script and script is updated. I know is tedious but better of nothing...

Comment
Add comment · 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
  • 1
  • 2
  • 3
  • ›

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Problem: Adding and Subtracting score 1 Answer

Value sometimes isn't updated. 1 Answer

Where are the built scripts stored in a build? 1 Answer

Check if Android device using wifi? 3 Answers

how do i make this to a negative (ShopRespawn < 180)? 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