Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Duetschbag · Nov 28, 2016 at 02:33 AM · unity 5scripting probleminspectorupdatevisual studio

Why aren't my scripts updating in my project?

I installed Unity fresh a couple of days ago and started a new project. Scripts updated just fine for the first day and a half. I have been using Visual Studio as my IDE but have confirmed that this issue also occurs in MonoDevelop. Currently, anytime I make a change to a script, the script does not update inside of Unity. This also happens in another project that I created.

For example, if I change "public float projectileCollsionOffset = 4.0f;" to "public float projectileCollsionOffset = 5.0f;" in my script, I can look in the inspector and it will still be set to 4. Setting the number in the inspector also does not reflect the change in the script.

Removing the script completely from my player object and re-adding it after the changes are made does in fact work. However this is extremely tedious.

Can someone explain why this occurs and how to fix it?

I have read that it may have something to do with the meta files but haven't found any useful information on what to change with the meta files so that it fixes the issue. It may not even be related to meta files, but that's what I found so far.

Comment
Add comment · Show 8
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 TBruce · Nov 28, 2016 at 02:33 AM 0
Share

Take a look at the console. I have found this to happen if one or more scripts have errors (an error will show up in red in the console).

avatar image Duetschbag TBruce · Nov 28, 2016 at 10:59 PM 0
Share

Thanks for the reply. Unfortunately, there are no errors in the console.

avatar image Duetschbag · Nov 29, 2016 at 03:47 AM 0
Share

I should also note that this evening I started a new project and ran into the same issue. I also uninstalled and reinstalled Unity and the issue still occurs.

avatar image alexanderameye · Nov 30, 2016 at 04:44 PM 0
Share

What about using Unity 5.5, that might fix it?

avatar image Duetschbag alexanderameye · Nov 30, 2016 at 10:05 PM 0
Share

I just upgraded it this morning and it still doesn't work.

avatar image ebrown38 · Nov 30, 2016 at 08:59 PM 0
Share

Sometimes, for me at least, scripts won't update right away in the inspector, even when I save them. Try playing the script, that usually causes it to update for me.

avatar image Duetschbag ebrown38 · Nov 30, 2016 at 10:07 PM 0
Share

Unfortunately, this did not work for me. When I highlight the script, I can see the change in the preview that shows up in the inspector. However, when I select my empty game object and look at the public variable, it did not change. So the value in the script is changing, but that change isn't making it's way to the inspector.

avatar image Duetschbag · Dec 01, 2016 at 12:09 AM 0
Share

Adding to this, if I go to the script in the inspector and click the little gear in the top right corner, I can use the "Reset" option in the drop down to update the script. It's frustrating to say the least, but at least it's a temporary workaround. Still open to suggestions on how to fix the issue though.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by GameEverything · Aug 31, 2017 at 03:48 AM

I'm really surprised there hasn't been an answer to this. Anyway, I had this problem today and I had no idea it was occurring until I asked myself if it was. I was going nuts thinking certain code wasn't accessible due to scope, etc.. Nope, it was that VS and Unity weren't actively syncing.

How it happened:

Had 5.6 project. Upgraded Unity to 2017. Upgraded VS to 2017. Updated 5.6 project to 2017.

Solution:

Reimported all assets.

The test:

Added simple Debug.Log statement to a Start function attached to a GameOjbect, pressed play in the editor, changed the parameter in the Debug statement, pressed play in the editor again, saw changes, changed the parameter in the Debug statement, pressed play in the editor again, saw changes, changed the Debug parameter and updated while playing in the editor, pressed stop, and finally pressed play again to see the changes.

Looks good to me so far. Of course, I'll come back here first thing if there are any problems.

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

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

7 People are following this question.

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

Related Questions

Why is Unity showing the wrong variables in the Inspector? 1 Answer

Update function not updating like it should be.? 1 Answer

Help me please... I have this script but its doesn't drag objects 0 Answers

My movement script is not moving my 2D object 2 Answers

Does this Truncate formula seem efficient? 2 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