Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
Dismiss Notice
Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.

Unity Hub and VSCode Debug

Discussion in 'Unity Hub' started by seec1, Jan 30, 2018.

  1. seec1

    seec1

    Joined:
    Jun 6, 2016
    Posts:
    11
    Hi there,
    First of all, thanks for useful tool. It's help me very much.

    When I use VSCode to debug my game, VSCode detect Unity and Unity Hub like a Editor
    This is error: Multiple targets with name 'Unity Editor' running. Unable to connect.

    Any idea to pass it?
    Thanks and best regards.
     
  2. AbrahamDUnity

    AbrahamDUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    431
    Hi,

    Thank you! We hope you enjoy the tool.

    As for the VSCode issue, we will investigate the problem. Which version of Unity/VSCode were you using when the problem occurred?
     
  3. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    346
    Happening to me with 5.6.5.p1, vscode 1.19.3. If you attach via the command palette you I get a drop down like this:

    Unity Editor (Unity)
    Unity Editor (Unity Hub)
    Unity Editor (Unity Hub)
    Unity Editor (Unity Hub)

    To get around it on windows you have to kill the process from task manager even after you close Unity Hub.

    Cheers.
     
  4. AbrahamDUnity

    AbrahamDUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    431
    Thanks! We will look into it.
     
  5. EmilSVad

    EmilSVad

    Joined:
    Dec 7, 2016
    Posts:
    1
    if any others have the same problem you can fix it with changing you launch.json file in the .vscode folder so instead of the first part of the configuration begin

    {
    "name": "Unity Editor",
    "type": "unity",
    "request": "launch"
    }

    to

    {
    "name": "Unity Editor (Unity)",
    "type": "unity",
    "request": "launch"
    }
     
    RG_Keith, Its4u, seec1 and 2 others like this.
  6. seffles

    seffles

    Joined:
    Oct 2, 2013
    Posts:
    32
    This didn't work for me on MacOS, I still get the same error.
     
  7. joeksy

    joeksy

    Unity Technologies

    Joined:
    Jan 12, 2017
    Posts:
    156
    Hi,
    We are working on a solution. There will be an update on the "Debugger for Unity" VS code extension.
    Stay tuned!
     
    RG_Keith, seec1 and seffles like this.
  8. Dual-Pistolas

    Dual-Pistolas

    Joined:
    Oct 30, 2014
    Posts:
    16
    I was getting the same error on Windows 10, Unity 2017.3.0p4.

    Making that change to launch.json fixed it for me until the extension is updated.
     
  9. pragmascript

    pragmascript

    Joined:
    Dec 31, 2010
    Posts:
    101
    Has this issue been addressed at all? I am having the same issue in Unity 2021
     
  10. cordula26

    cordula26

    Joined:
    Apr 12, 2021
    Posts:
    1
    Hi,
    Has this issue been addressed at all? I am having the same issue in Unity 2021 [2]
     
  11. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    414
    I'm having this problem as well, it seems that (on Mac at least) there are constantly 2 Unity processes running, I can force quit the 2nd one without any issues but every time I press Play in the editor the 2nd unity process restarts.
     
    pragmascript likes this.
  12. pragmascript

    pragmascript

    Joined:
    Dec 31, 2010
    Posts:
    101
    Hi reporting back in: I'm still having this issue in unity 2022.1. Is no one at unity trying to use the debugger or why is this still not resolved? I would assume not being able to easily debug your code should be a high priority issue?
     
  13. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    346
    Unity dropped official support for vscode. Only support VS or rider now.
     
  14. pragmascript

    pragmascript

    Joined:
    Dec 31, 2010
    Posts:
    101
    Ah okay, thank you I missed that.

    I'm not sure what the rationale is for dropping support for the most popular editor though.
     
  15. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    346
    pragmascript likes this.
  16. yaxamie

    yaxamie

    Joined:
    Mar 11, 2017
    Posts:
    6
    The webpage here says:

    "Visual Studio Code can be a great companion to Unity for editing C# files. All of the C# features are supported and more. In the screen below, you can see code colorization, bracket matching, IntelliSense, CodeLens and that's just the start."

    None of that feels super deprecated to me.

    I'm confused by this whole thing. I only started getting this error after updating to the latest LTS (Mac User).
     
  17. R0dluvan

    R0dluvan

    Joined:
    Nov 16, 2016
    Posts:
    1
    Editing the .json to "Unity Editor (Unity)" did nothing for me, but opening the Command Palette in VS Code (Ctrl+shift+P) then typing "Unity Attach Debugger" got me a list of options where I could select the correct instance.
    upload_2022-10-15_13-47-58.png

    (After this, you should see encouraging console messages like
    Code (CSharp):
    1. UnityDebug: Attached to Unity process 'Unity Editor (Unity)' (3324)
    2. Resolved pending breakpoint at 'e:\Unity\VR2020Test\Myproject\Assets\...
    ) and then you can start your Unity project and hit breakpoints and stuff.
     
  18. Pnvanol

    Pnvanol

    Joined:
    Jan 11, 2016
    Posts:
    86
    I only see Unity editor (Editor) 14500 null on those options, any idea?
     
    Last edited: Oct 28, 2022
  19. AlexGoro

    AlexGoro

    Joined:
    Mar 31, 2021
    Posts:
    1
    You need to change path in launch.json.
    Works for me.

    {
    "name": "Unity Editor",
    "type": "unity",
    "path": "${workspaceFolder}/Library/EditorInstance.json",
    "request": "launch"
    }