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. Dismiss Notice

Double clicking error in console doesn't go to line in VS Code etc

Discussion in 'Scripting' started by davidnibi, Feb 9, 2020.

  1. davidnibi

    davidnibi

    Joined:
    Dec 19, 2012
    Posts:
    424
    If I have an error in the console, I have usually just double clicked on the error and it goes straight to the line in the script

    However, now it is just staying on the line I was at previously and doesn't update.

    Does anyone have any ideas? I'm using Visual Studio Code (which is becoming a bit of a time-consuming burden tbh).
     
    rahulnaik9010 likes this.
  2. davidnibi

    davidnibi

    Joined:
    Dec 19, 2012
    Posts:
    424
    I went to browse in preferences and reselected code.exe
    in
    C:\Users\username\AppData\Local\Programs\Microsoft VS Code
    and it seems to work now
     
  3. GarrettCMiller

    GarrettCMiller

    Joined:
    Jan 20, 2013
    Posts:
    30
    Hi, I'm having the same problem too, double-clicking a line in the Console output no longer takes me to the relevant line of code. Nor does that action (or any other similar "Edit Script" action)do anything but open the relevant file. It no longer opens the Solution file or any Project files.

    @davidnibi
    I didn't quite understand what you meant by "reselect"-ing an .exe file, at first. Until I re-read what you said and went to Unity's "Preferences/External Tools" menu and selected (in my case) Visual Studio 2019 (Community) and now it works for me as well. Just FYI for anyone that's having the same issue.
     
    drhmiri likes this.
  4. Taylor-Howell

    Taylor-Howell

    Joined:
    Feb 8, 2018
    Posts:
    2
    Hey all, I had the same problem. I tried all that was mentioned above and it didn't work. What did work though was clicking on the console settings (three dots in the corner of the console window) and making sure the Stack Trace Logging\Error\ is not set to "Full," rather it should be "Editor Only."

    Does someone know why this is the case?
     

    Attached Files:

    unity_lQOk1iqe2kYvwg likes this.
  5. Greviouss

    Greviouss

    Joined:
    May 27, 2016
    Posts:
    120
    reimport your project ;)
     
    drhmiri likes this.
  6. facejets

    facejets

    Joined:
    Oct 7, 2018
    Posts:
    9
    For me, in Unity I went to Edit> Preferences, and in there, External Tools. There I clicked a button that said "Regenerate Program Files"
     
    daveblancas likes this.
  7. Panundrum

    Panundrum

    Joined:
    Sep 15, 2019
    Posts:
    1
    I just came across this issue myself and my fix was:
    In Unity:
    Click Edit --> Preferences --> Click external tools
    Then at the top where it says External Script Editor, Choose the proper Visual Studio you want to use.
    Mine was set on "Open by file Extension"
    As soon as I set it to: "Visual Studio 2019"
    It worked perfect.
     
  8. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    237
    For me what fixed it:
    in console: first click the three dots in the right > stack trace logging > all > full
    Then click play (now it won't work)
    then in console again: click the three dots in the right > stack trace logging > all > script only
    Click play
    Now clicking in the console should open the script and jump to the correct line.
     
  9. Kheremos

    Kheremos

    Joined:
    Dec 13, 2017
    Posts:
    17
    None of the above worked for me. I'm not sure why changing the logging would have an impact to begin with.

    I'm seeing this in editor:
    upload_2021-9-28_13-24-54.png
    Microsoft Visual Studio is Version 16.10.4

    I have my tools configured here:
    upload_2021-9-28_13-26-13.png

    And [Regenerate project files] has no effect. I've restarted my project and the editor, the issues still persist.
     
  10. daveblancas

    daveblancas

    Joined:
    Aug 27, 2021
    Posts:
    2
    This worked for me using Mac and Unity 2021. Thank you.
     
  11. ManieBesselaar

    ManieBesselaar

    Joined:
    Nov 1, 2018
    Posts:
    29
    Solved it for me , thanks!
     
    Jelmer123 likes this.
  12. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,058
    thanks a lot
     
    Rachan likes this.
  13. MBonKov

    MBonKov

    Joined:
    Aug 12, 2014
    Posts:
    1
    Hey, had this issue after a random crash, turn out my game's project somehow switched to "release mode". Switching back to debug mode solved the issue. (unity2021.1)
    upload_2022-2-18_13-50-37.png
     
    f4bo likes this.
  14. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,058
    thank a lot great to know.
     
  15. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    660
    Thank you very much!!!
     
  16. mikesawicki64

    mikesawicki64

    Joined:
    May 12, 2014
    Posts:
    33
    My solution for this issue on 2021.3.5f1
    upload_2022-7-18_1-28-3.png
     
  17. facucan

    facucan

    Joined:
    Mar 8, 2017
    Posts:
    3
    Thankssss

    This was the only thing that worked for me (Unity 2020.3.30f1, Visual studio Community 2019 Version 16.11.20
     
    Daniel-F likes this.