Unity Visual Studio For Mac

Visual Studio for Mac will replace MonoDevelop-Unity as the default C# IDE for using Unity on macOS, while Windows installations will continue to feature the free Visual Studio 2017 Community edition and will no longer include MonoDevelop-Unity as an alternative.

Awesome!! Today, Microsoft released a “code optimized” version of Visual Studio called Visual Studio Code that will run on Mac and Linux (and of course Windows). And it is BEAUTIFUL! I’ve been looking for an alternative to MonoDevelop with Unity 3D for some time, and VS Code feels like it might be the real deal.

Visual Studio For Mac With Unity

Setup Unity and Visual Studio on Mac and PC. Use Unity's editor to position, rotate and scale game objects. Understand prefabs. Write very basic code, and use Unity's Console. Unity, the world’s leading real-time engine, is used to create half of the world’s games. Our flexible real-time tools offer incredible possibilities for game developers, and creators across industries and applications in 2D, 3D, VR, and AR. Using Unity and Visual Studio for Mac, you can create awesome games that run on any platform. Use the powerful coding, refactoring, and debugging features in Visual Studio for Mac to enhance your productivity.

After updating Visual Studio for Mac as well as a number of other packages this morning (prompted for update by VS auto-updater in stable channel), Visual Studio can no longer debug Unity projects. It looks as if the Unity plugin is no longer being loaded (no hint in Unity's About dialog). Unity is a powerful solution to create games for a multitude of platforms, from mobiles to consoles, desktop and web games. Since Unity 5.2, Visual Studio and the Visual Studio Tools for Unity have been the default experience on Windows. When we released Visual Studio for Mac last year, Unity was among the first scenarios we supported out of the box.

Some early commenters on the Unity 3D forum were peeved that it’s not a full-blown IDE, or “it’ll only be good for Javascript and web dev”. Do not listen to the naysayers! Granted, it is a “Preview” version product, but so far, it is working with Unity 5 like a charm.

Microsoft

Setting up VSCode for Unity is Simple, but Read This!

It is simple to get it working, but you need to do a couple of things. Some people on the Unity forums tried to simply download Code and open their c# files and the intellisense didn’t work, and they assumed that VS Code was a bust. I admit, that’s exactly what I did, but I didn’t give up. Here are the simple steps:

  1. Download and install Visual Studio Code from Microsoft
    1. It’s simple on the Mac…just drag the .app to Applications folder once you open the downloaded package
  2. Open your Unity project
  3. Go to Assets > Sync MonoDevelop Project (this will make sure your .sln file is all set)
  4. Open VS Code
  5. Do File > Open in VSCode and open your Unity project folder (top level of your project)
  6. Important – at the bottom of the VS Code window, there is a blue status bar. You should see a little fire icon. It may be followed by # projects. Click that icon and select your project’s csharp.sln file. When you click the icon, it will pop up a box at the top that lists the available solution files. You want the one that is named “<your project name>-csharp.sln”.
    1. If the box at the top of the screen has an option that says “Change projects”, that means you’re already working in a project. In this case, you can:
      1. Click “Change projects”
      2. Then select your project’s csharp.sln file as above

Visual Studio Code on a 2013 MacBook Pro- 1st Day Impressions

Unity
  • Intellisense is working beautifully with my project’s code
    • You can even leave a word half finished go away with the cursor and come back and Intellisense will pick it up and start working where you left off. I’ve been using VS 2010 at work lately and it doesn’t do that…very annoying
  • VSCode is fast and responsive
  • It looks great!
  • Haven’t tried the Git and probably won’t. I’m using SourceTree for BitBucket with Unity and the integrated client in Xcode for normal dev
  • It feels like a native Mac app, but some of the Keyboard shortcuts aren’t Mac…maybe there’s a way to fix that
    • For instance, Cmd-Delete is supposed to delete everything to the left of the cursor back to beginning of the line of text you’re on, but it doesn’t appear to be doing anything
    • Shift+Cmd+k deletes the whole line
    • Control-Delete, weirdly, duplicates the text on the line…huh.
    • Control-Clicking on a file in the file tree opens the code in side-by-side view with the existing file in the editor…neat
    • I tried editing the Keyboard shortcuts, but adding my edits to the override file didn’t work, even after restarting the app. You can tell it’s early days since that process is you editing a json file.

All-in-all, I’m very happy to have Microsoft supporting Mac with this. They also announced a code transformer that will let you take your iOS objective-c code and port it to Windows phone with minimal tweaks. That’s going to be interesting too. Microsoft is really doing some very interesting things. Good on ya!

Cheers,

Byron

Active1 year, 1 month ago

I am running the latest version of Visual Studio and the latest version of unity. When I open the project using Visual Studio for Mac, I am able to rebuild the app.

But, when I try to start debugging, I am getting Execution Failed without any explanation or build output.

I am able to run the app successfully on iOS through Xcode, although the iPad is refusing to start the app automatically and I have to open it manually.

The issue is that , I can't start the app on Visual Studio for Mac.

Unity3d Visual Studio For Mac

Ali123Ali123

Unity Visual Studio Mac Download

1 Answer

Apparently, If you open multiple instances of Unity, Visual Studio for Mac will get confused and will not know which project to attach to.

Unity And Visual Studio For Mac

Having one instance solved the issue for me.

Ali123Ali123
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Unity Visual Studio Code Mac

Not the answer you're looking for? Browse other questions tagged unity3dvuforiavisual-studio-mac or ask your own question.