• 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
1
Question by dsillman2000 · Feb 23, 2014 at 05:56 PM · errornamespacenot found

UnityEngine could not be found?

Thanks for looking at my question. I am trying to code my game in MonoDevelop(C#), but I could never compile correctly because, next to the line,

 using UnityEngine;

The error said,

 using UnityEngine;                The type or namespace name 'UnityEngine' could not be found. Are you missing a using directive or assembly reference?

I recently started coding this at my dad's house on a PC. I transferred it over here, to my Mom's house (on a Mac), using Google Drive. Now, all of a sudden this error won't stop showing up.

Help please?

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 KiraSensei · Feb 23, 2014 at 05:57 PM 0
Share

Do you have Unity installed in the second computer ?

6 Replies

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

Answer by dsillman2000 · Feb 23, 2014 at 07:16 PM

OKAY I found out what was wrong. Something happened to my monodevelop when loading my files, so I reinstalled Unity, and suddenly UnityEngine could be found. Yay!

Anyone else with a similar problem, just reinstall!

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
5

Answer by zhangyutong926 · Nov 16, 2015 at 04:34 PM

Hey, you needn't to reinstall your Unity. You can try to add the namespace "UnityEngine" manually. Normally, your UnityEngine reference is here: {Install path of Unity}/UnityProjectTest/Library/UnityAssemblies/UnityEngine.dll I'm not sure how to add it in MonoDevelop but I am sure in Visual Studio. alt text And then, left click "Add Reference...". Now you see the following frame and left click that button named "Browse". alt text Then, find out your UnityEngine.dll and select it. Trust me, I've fixed similar problem. I lost my UnityEditor Reference. All done, you've finished.


a.png (190.7 kB)
b.png (12.2 kB)
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 ProGaminGranny · May 13, 2017 at 09:42 PM 1
Share

Thank you, pointed me in the right direction. Turns out my .dll files were converted to .X$$anonymous$$L files somehow from github. I just deleted the folder and it regenerated the folder when I opened my project again.

avatar image askpunk · Jul 12, 2020 at 01:26 PM 0
Share

thank you,

avatar image
5

Answer by pbastia · Sep 28, 2016 at 08:43 PM

I found another way of repairing that: It happened to me after some git mishap, and the references were gone.

To have Unity redo the bindings and reimport the dlls properly, just remove your Library\UnityAssemblies folder and reopen the project.

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 GregoryFenn · Jul 14, 2018 at 05:22 PM 0
Share

This also fixed a similar glitch for me that I suspect was linked to changing my editor version. I always upgrade to the most recent, regardless of the consequences!

avatar image
3

Answer by ESG-Steven · Jun 21, 2017 at 10:14 PM

Something that worked for me was to just close Mono, delete all the of .csproj files in my Unity project base folder, then re-open it through Unity

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 Errox · Apr 20, 2020 at 08:52 AM

Might be a rare occurence for others; anyhow, here's what happened to me:

I occasionally switch workstations (PC to laptop). In doing so I plug/unplug my SSD. Guess what — the directory in which Unity is installed is different depending on the station. Took me only a couple of days to figure that one out.

So now I adjust HintPaths on all References inside the Assembly-CSharp.csproj file manually. Just takes a second and won't bother me too much as I don't switch all too often anyways.

Hope this saves someone a day or two (fine, may as well be just a minute).

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
  • ›

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

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

Related Questions

How I can fix This? HELP ME! 0 Answers

UnityEngine.dll doesn't fix namespace error? 1 Answer

Unity started rejecting my scripts? 1 Answer

A script by that name already exists... so what? 5 Answers

Project structure, finding scripts vis GetComponent and related errors 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges