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
0
Question by Tricky7991 · Nov 26, 2012 at 10:46 PM · errorunity4compile

Error with scripts compiling Unity4.

Hey Unity Community! Well I am having problems with Unity 4. I was building this on the last version of Unity3 and all was working good. Got the Unity4 beta backed up my project. Then used Unity4 to upgrade it. And everything worked flawlessly.

So I deleted the old Unity3 project backed up the new one. Today I started Unity and saw that there was a update. So since i still had Unity3 installed along side Unity4. I decided to wipe clean all Unity and Reinstall Unity4 with the new update.

Well after I did that got it installed. Opened my project, and got a error about Namespaces. And on all my prefabs that had scripts, it said that

"The associated script cannot be loaded. Please fix any compiling errors and assign a valid script."

That is on every script even Unity's default ones. I've rechecked the scripts over and over. And can't find the problem.

So any help would be good. Thanks in advance! And if this has already been asked I looked but I didn't see it so a link to the answer would be great!

alt text

alt text

add.png (8.3 kB)
insptr.png (18.2 kB)
Comment
Add comment · Show 10
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 code-blep · Nov 27, 2012 at 09:15 PM 0
Share

Hi Aaron,

Please post a sample of the errors that show in your Console. That will give us a far better idea of what is going on ;)

avatar image Benproductions1 · Nov 27, 2012 at 10:00 PM 0
Share

Please be more specific and post an example (code or screenshots) With the information above you really cant do anything.

avatar image Tricky7991 · Nov 27, 2012 at 10:08 PM 0
Share

Just added pics to it of the errors. Scripts are fine cause I am using them in another project without errors. Same scripts no changes.

Like I said only did this after a clean install of Unity4 after I upgraded the project using Unity4 BETA.

If you need anymore info let me know.

avatar image code-blep · Nov 27, 2012 at 11:02 PM 0
Share

Hmmmm, not sure about this problem. Not encountered it before. I'll have a think though. Anyone else?

avatar image Benproductions1 · Nov 28, 2012 at 12:49 AM 0
Share

Try a reimport of your scripts

Show more comments

5 Replies

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

Answer by Tricky7991 · Dec 14, 2012 at 03:08 PM

If you have this error too after upgrading to Unity4, You will have to make a fresh project. And import all the scripts, models, textures, materials, sounds. And then remake all your prefabs/gameobjects.

Seems like something random that happened switching to Unity4.

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
avatar image
0

Answer by Nidre · Dec 13, 2012 at 05:29 PM

There are some methods etc. that have been replaced or removed in Unity 4.Maybe somehow it doesn't show you those changes as errors/warnings in your code.If you are on Windows you can try to open your solution with Visual Studio and try to build it there(It might fail to build that's not the point).Visual Studio will check for all syntax errors when you press build.So if there is error in your code somehow it will find for sure.

Well its not the best solution but since there is no accepted answer i think it might worth trying.

Comment
Add comment · Show 11 · 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 Tricky7991 · Dec 14, 2012 at 01:21 PM 0
Share

Thanks for help! But as I mentioned before the code is fine. But since the errors I'm getting do seem like there is a error in the code. I am adding the answer myself now. Thank you again I wasn't sure if this just got forgotten.

avatar image Nidre · Dec 14, 2012 at 01:34 PM 0
Share

I see you are using both JS and C# scripts together.There might be problem with the compile order.As i know you should make sure your Javascript compiles before C#.To be able to reach them from your C# scripts.

$$anonymous$$aybe that order might be causing some of scripts to be detected as problematic.

avatar image Tricky7991 · Dec 14, 2012 at 02:01 PM 0
Share

Ok so Unity has now forgotten how too? Since it worked before I switched from Unity4 Beta to Unity4. If the scripts are the problem(something not coded right) then why do they work in other and new projects fine without any errors?

avatar image Nidre · Dec 14, 2012 at 02:07 PM 0
Share

I'm not telking about how the script has coded.Im talking about compilation order. They might have changed something under the hood and might be affecting compilation order.

And as i said "$$anonymous$$aybe" that might be the reason :)

avatar image Nidre · Dec 14, 2012 at 02:09 PM 0
Share

You might want to check http://answers.unity3d.com/questions/146192/using-c-and-javascript-in-a-project.html this answer if thats the case.

Show more comments
avatar image
0

Answer by j-unity · Dec 16, 2012 at 08:39 PM

EyAaron,...if I´m not wrong Unity4 is really strict reading code as it detects any compilation error al a global fail...so if you have an script wich as an error it probably shows you the messages you added to us. Just try to read in the CONSOLE the script that is giving you an error an try to delete it ( or just maybe select all the code in the script and transform it as a comment ) just to check than when you play then again the messages dissapear...

Let me know if it works for you. If not we´ll try to help you.

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
avatar image
0

Answer by signal1101 · Apr 11, 2013 at 10:32 PM

I've run into this via some source control software that doesn't resolve metadata and script assemblies. Try doing a quick build of your project for any platform. That should relink your data and get things back to where they should be for you. At least, that's resolved it in the past for me.

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
avatar image
0

Answer by Gal-la · Jul 25, 2014 at 09:05 AM

you have if empty like if(nam < 10) <-and here is empty if(nam < 10) {

} <- it fix it

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

19 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

Related Questions

After switching platforms, script assets purchased from store don't compile and reference to them is lost 1 Answer

Compilation failed because the compiler couldn't be executed. 1 Answer

Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error 1 Answer

completely lost noob 1 Answer

GetComponent(Script) Error(Won't detect script) 0 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