• 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
4
Question by limonad76 · Sep 20, 2011 at 11:01 PM · namespace

unity 3.4.1f5 namespace error

Right after installing 3.4.1f5 I've got message "Namespace 'UnityEditor' not found, maybe you forgot to add an assembly reference?" error when compile the project. This error is present in Standart Assets scripts only (CharacterMotor, camera scripts etc). WTF?)

Comment
Add comment · Show 9
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 daniel_horn · Sep 21, 2011 at 12:03 AM 0
Share

I got these as warnings in the previous revision of Unity, but in today's update I get the above as errors as well.

I'm considering porting the files to C# to see if that fixes it--does anyone else know why it thinks those javascript files are referencing UnityEditor?

Edit: wow these files are really long: any one have a solution that doesn't involve $$anonymous$$dless porting of the javascript scripts to C#?

avatar image liuqingzhi · Sep 21, 2011 at 08:59 AM 1
Share

I got the same problem.

avatar image York Wu · Sep 21, 2011 at 09:36 AM 1
Share

I got the same problem, too. I can do nothing but roll back to older version since I have a lot of JavaScript code.

avatar image limonad76 · Sep 21, 2011 at 09:57 AM 1
Share

Take the time to do rollback. I have this problem while compilation but looks like my own scripts compiled and works properly.

avatar image DanDixon · Sep 22, 2011 at 12:11 AM 1
Share

Same problem here. When I click the "Debug" button (the gears) in $$anonymous$$onoDevelop I get this error in AntialiasingAsPostEffect.js (in Standard Assets/Images Effects (Pro Only)).

Rolling back to 3.4.0 fixes this problem.

I'm running on a Windows 7 machine.

Show more comments

12 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by HusbyFan · Oct 12, 2011 at 05:50 PM

Bug in 3.4.1f5, they say they will update it in the next patch...

http://forum.unity3d.com/threads/106289-Unity-3.4.1-With-BIG-issue-in-MonoDevelop!!!?highlight=namespace+error

Temporary solution in monodevelop should be:

  1. to go to the solution panel on the left,

  2. open assembly-Unityscript->references,

  3. and delete all references BUT the "UnityEngine.dll".

Will reset if you close monodevelop again, and not very stable imo, but at least it gives you a sort of "thumbs up" if it works by giving you some other errors ;)

Comment
Add comment · Show 2 · 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 wccrawford · Oct 13, 2011 at 07:21 PM 0
Share

Thanks for this. It's a shame that I can't vote you up, and that nobody else has bothered.

avatar image jite · Mar 18, 2013 at 11:00 AM 0
Share

It also works for Unity up to 4.1 :)

avatar image
1

Answer by msknapp · Sep 23, 2011 at 03:33 PM

If you look in the script files that are in error, do you see a line at the top that says "using UnityEditor;"? Or do you have code that uses any class from the UnityEditor library?

You might know this but in case you don't... You cannot use the UnityEditor classes except from within the "Assets/Editor" folder. Those classes can only be used in the editor, not at runtime.

If you do see that line, then remove it. If you have classes that come from that library, you must remove them as well from your code. Alternatively, you can move that class file into the "Assets/Editor" folder.

Comment
Add comment · Show 8 · 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 msknapp · Sep 23, 2011 at 03:47 PM 0
Share

maybe one of the classes you use was moved from a runtime class to an editor class between the different versions of unity.

avatar image daniel_horn · Sep 24, 2011 at 11:35 PM 0
Share

No mention of UnityEditor anywhere. If I delete everything in the .js files it seems to compile, but as soon as I add a single line of javascript, the compiler starts complaining.

For reference the warning in 3.4.0 was: Line 1 WARNING: Namespace 'UnityEditor' is never used. (BCW0016) Character$$anonymous$$otor.js

This seems to confirm that using UnityEditor isn't the problem...the problem seems to be with the engine thinking that we are requesting to use UnityEditor without using it.

avatar image Evil-Dog · Sep 25, 2011 at 05:12 AM 0
Share

Any news about that? I have the same exact problem since getting the new version, not being able to run in debug mode is rather frustrating.

avatar image limonad76 · Sep 25, 2011 at 06:16 AM 0
Share

Its strange) I have this error but I can compile and run my own scripts properly not paying attention to this error.

avatar image limonad76 · Sep 25, 2011 at 06:21 AM 0
Share

I do not see the line "using UnityEditor". I do not change anything in this scripts. I just installed update and immediately got this error.

Show more comments
avatar image
0

Answer by Bunny83 · Sep 25, 2011 at 10:52 AM

I guess the problem is that UnityScript automatically includes the UnityEditor namespace by default. That's usually not a problem. As long as you don't use anything from that namespace you just get some kind of "not used namespace" warning which should be disabled for UnityScript.

Beside the "using Bla;" in C# and "import bla;" in UnityScript the assembly that contains this namespace have to be added to the project. In the case of UnityEngine and UnityEditor that are "UnityEngine.dll" and "UnityEditor.dll" That is usually done automatically by Unity when you sync the solution.

Maybe they changed something in the last update, you can try to delete the .sln and .csproj files from your project directory and re-sync your project in Unity. If that doesn't help there might be a problem in this Unity version. If that doesn't fix the issue you should file a bug report so the Unitystaff notice the 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 York Wu · Sep 26, 2011 at 01:49 AM 0
Share

I tried this way but it doesn't seem work. Then I open Edit Perference dialog, I see UnityEditor package under selected references. But it doesn't work by removing that entry, either.

avatar image
0

Answer by Aljosha · Sep 26, 2011 at 04:08 PM

I had the same problem when upgrading to the new unity version. Directly running from MonoDevolop doesn't work anymore but starting unity and attaching MonoDevelop does work!

So: - start Unity - MonoDevelop: Run -> Attach to process... - set breakpoints and Start your scene.

Aljosha

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 stereosound · Sep 27, 2011 at 04:32 AM

Downloaded unity on my new windows 7 64-bit computer, I get the error:

"namespace 'unityeditor' not found, maybe you forgot to add an assembly reference? (BCE0021)"

even when starting a new project and attaching a simple script to a cube. This issue is CRIPPLING to my design schedule; I need to sort out what is happening asap!

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

error CS0246: The type or namespace name `rect' could not be found. 1 Answer

Why should we don't use namespace? 1 Answer

Unity overwrites files with the same name but in different namespaces on package import? 6 Answers

Namespaces usage recommendation 1 Answer

Inspector references and scripts with the same name 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