Search Unity

Type or namespace UnityEngine could not be found

Discussion in 'Scripting' started by M0rkDesign, Mar 18, 2013.

  1. M0rkDesign

    M0rkDesign

    Joined:
    Mar 18, 2013
    Posts:
    3
    Hi everyBody,

    I'm really new to unity and it may be something really simple...

    So, the issue I got is that using "Xamarin studio" (think is the monodevelop for windows or something like that)
    when I'm trying to build a file, which contains "using UnityEngine"(and kinda any file does) the compiler gives me this error

    -Type or namespace UnityEngine could not be found....check assembly...-

    I've been looking around with google and i found out it is something like a _C #include_ or _java import_ missing
    But how can it be so? I mean it's supposed to exist D:


    Thanks in advance and sorry for my English :D
     
  2. ardo314

    ardo314

    Joined:
    Jul 7, 2012
    Posts:
    345
    I didnt heard of xamarin studio before, however yo ucould just use monodevelop which ships with unity.

    Considering your error you might need to import the appropriate dll into your assembly.
     
  3. EliteMossy

    EliteMossy

    Joined:
    Dec 2, 2012
    Posts:
    513
    You can't compile in anything but unity. You can but only to a DLL.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    That's right. Don't do a build in your IDE, you should only use it as a text editor. Hit save and return to the Unity editor, it'll detect the file as having changed and do a compile internally. A handy hint is to make sure you've got the console window open so you can more easily see any errors.
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Do you synchronize in Unity (Edit -> Sync MonoDevelopProject) before you work in Xamarin Studio?
     
    Last edited: Mar 18, 2013
  6. M0rkDesign

    M0rkDesign

    Joined:
    Mar 18, 2013
    Posts:
    3
    Wow lots of answers

    mmhmm if I set Unity>Edit>preferences>Ext.Tools>MonoDevelop(built-in) it gives me this error

    - "Unable to open Assets/Scripts/Item.cs: Check external application preferences"

    where Item.cs is the file...

    And also: how do you build files in Unity? It does it itself?

    Last thing -Dantus-, I'm not able to find Edit>Sync :p

    Thanks again for the help
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    My fault, it is Assets -> Sync MonoDevelop Project.

    If you have selected Xamarin Studio as your editor, you can use that Sync to start it and it should mostly work.
     
  8. M0rkDesign

    M0rkDesign

    Joined:
    Mar 18, 2013
    Posts:
    3
    ahn ok thanks !
     
  9. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    Something that worked for me was to just delete all the of .csproj objects in my unity project base folder
     
  10. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Just for some clarity and to consolidate the information in this thread:

    • You dont need to "build" your code, when you switch back to Unity it compiles any changes automatically.
    • It doesnt matter the IDE you use, you could even use Notepad or Wordpad if you really wanted (Although its not recommended)
    If it still doesnt work, just try adding UnityEngine.dll as a reference in your projects solution.