Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

API help shortcut in Visual Studio?

Discussion in 'Editor & General Support' started by Avichal, Jul 28, 2015.

  1. Avichal

    Avichal

    Joined:
    Jul 14, 2015
    Posts:
    4
    Hello fellow developers,

    I have been trying to figure out how can I access the unity script documentation using a shortcut in Visual Studio.
    So I found this answer :http://answers.unity3d.com/questions/139547/api-help-in-visual-studio.html

    But neither does (Ctrl+Alt+M, Ctrl+H) work or finding Help.UnityAPIReference(could not find it in Visual Studio Debug and Settings)

    I am using Visual Studio 2013 and using "SyncMonoDev" to work on it

    Thanks,
    Avichal
     
    EliasMasche likes this.
  2. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    VS 2013 has a slightly different location:

    Tools -> Options -> Environment -> Keyboard

    Under -->.Show Commands Containing
    Type --> Help

    Wait to see what comes up...

    Do you see Help.UnityAPIReference in the list?

    Click on it, then map the key to whatever you want below.

    Exit the Options, press the mapped key, and look in your solution explorer tab. It should be there
     
    jkar, vonSchlank, naveenkb and 4 others like this.
  3. Avichal

    Avichal

    Joined:
    Jul 14, 2015
    Posts:
    4
    I cannot see it there !
     

    Attached Files:

  4. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    In Unity, go to Edit -> Preferences -> External Tools. Did you link VS into unity?
     
  5. Avichal

    Avichal

    Joined:
    Jul 14, 2015
    Posts:
    4
    Hey I had not linked VS into Unity.

    I did it but I still don't see Help.UnityAPIReference
     
  6. Sickwitit

    Sickwitit

    Joined:
    Dec 22, 2014
    Posts:
    123
    Make sure it is fully linked. Write some code in VS, save it, then check the script in Unity. Just to make sure everything is syncing correctly.
     
  7. Avichal

    Avichal

    Joined:
    Jul 14, 2015
    Posts:
    4
    yes man, it syncs my code as soon as I save it. I had used Sync monodevelop, maybe I should first link VS and then use Sync monodevelop
     
  8. Natzely

    Natzely

    Guest

    Not sure if this is too late to help, but I had this issue as well. It took me a bit to figure it out. When the shortcut says Ctrl+Alt+M, Ctrl+H it means that first you press Ctrl+Alt+M this will change a blue bar at the bottom Visual Studios to read "(Ctrl+Alt+M) was pressed. Waiting for second key of chord..." this is when you then press Ctrl+H. They're not commands that will work by themselves, though Ctrl+H brings up the replace window.

    So, if you are familiar with other VS key shortcuts, it's like the mass comment key shortcut Ctrl+K to start it then Ctrl+C to comment the highlighted code or Ctrl+U to uncomment it. Hope this helps!
     
  9. AdamMcAdamson

    AdamMcAdamson

    Joined:
    Sep 10, 2015
    Posts:
    1
    I am having this issue as well. I have a clean install of Unity 5.2 with Visual Studio. Ctrl+' doesn't work (it's not supposed to) and Ctrl+Alt+M, Ctrl+H also doesn't work. VS tells me the command doesn't exist. I also cannot find Help.UnityAPIReference and I have VS linked with Unity.
     

    Attached Files:

    LittleRedBeast7 likes this.
  10. Ouakkaha

    Ouakkaha

    Joined:
    Mar 12, 2016
    Posts:
    4
    i also have the same issue, any help guys ????
     
  11. CreatOverflBrimstone

    CreatOverflBrimstone

    Joined:
    Mar 22, 2016
    Posts:
    1
    I have fixed this problem by reinstalling Visual Studio and all its components. After that is done, I got the "VS-Tools for Unity" from here: https://www.visualstudio.com/features/unitytools-vs
    After installing the .msi file, it worked for me.
    Maybe a reinstallation isn't even necessary, I haven't tried simply installing die File.
     
    Kreebog likes this.
  12. martibergoglio

    martibergoglio

    Joined:
    May 28, 2015
    Posts:
    14
    Hey guys, anybody knows if in VS Code are a Help.UnityApiReference shortcut? Im searching for all the web buy nothing happend...
     
  13. Kreebog

    Kreebog

    Joined:
    Apr 17, 2016
    Posts:
    2
    This fixed it for me, too. Thanks CreatOverflBrimstone!
     
  14. SunM

    SunM

    Joined:
    Apr 21, 2016
    Posts:
    1
    Thank you for your help
     
    jkar likes this.
  15. gerry31

    gerry31

    Joined:
    May 31, 2016
    Posts:
    1
  16. Syoyo123

    Syoyo123

    Joined:
    Jul 12, 2016
    Posts:
    1
    I had the same problem, and then I clicked the button ''Attach to Unity'' in Visual Studio (see image) and the combination Crt+Alt+M, Crt+H now works just fine. Hope this helps.
     

    Attached Files:

    • yeah.png
      yeah.png
      File size:
      39.9 KB
      Views:
      3,177
  17. emretekin

    emretekin

    Joined:
    Jul 22, 2016
    Posts:
    1
    upload_2016-10-3_3-27-32.png

    Go to attached.png screen then change Shortcuts for selected command as Ctrl + H.
    it was not like that before for me after i change fixed.
     
    Vasileios_P likes this.
  18. Dan_Miller

    Dan_Miller

    Joined:
    Sep 4, 2012
    Posts:
    31
    I'm having the same problem and trying to fix it by going to Options -> Keyboard -> Help.UnityAPIReference. Unity Tools is installed; Debug.AttachUnityDebugger and View.UnityProjectExplorer are listed under show commands containing. However, Help.UnityAPIReference is not listed and shortcuts do not work. Any ideas?

    Unity 2017.1 and VS 2017
     
    unity_RfZQ_1c9Npddgg likes this.
  19. unity_RfZQ_1c9Npddgg

    unity_RfZQ_1c9Npddgg

    Joined:
    Oct 17, 2017
    Posts:
    1
    I have the same problem! I can 'attach' VS to unity and that works but:

    Help.UnityAPIReference is not in environment -> keyboard
    ctrl + alt + m, ctrl +h says "Bound to Unity API which is unavailable"

    God this is an annoying problem. Any luck fixing it?
     
  20. todinger

    todinger

    Joined:
    Oct 25, 2017
    Posts:
    4
    It's a bug in Visual Studio 2017.
    I have the same issue here - the "short"cut Ctrl+Alt+M, Ctrl+H does work for me, but there's no way to change its binding.
    After searching I came upon this thread in the Microsoft Developer community, where it states:
    It's now fixed and pending release.
     
    madharuhi and paintingMist like this.
  21. paintingMist

    paintingMist

    Joined:
    Oct 22, 2014
    Posts:
    4
    Problem reported in VS 15.3. Still not fixed for me in VS 15.4.1 ... Perhaps the next release :(
     
  22. marioguttman

    marioguttman

    Joined:
    Jan 9, 2018
    Posts:
    5
    Not sure if this is still an issue but I don't feel like reloading VS to find out. Thought I'd share a partial solution: Create a shortcut in your Web browser to https://docs.unity3d.com/ScriptReference/ Then just keep the browser open and search for what you are looking for.
     
    marie-hmm likes this.
  23. iEXCEEDi

    iEXCEEDi

    Joined:
    May 26, 2018
    Posts:
    2
    I had this same issue. Tried all the above. None worked for me. Then I went to Visual Studio to check for packages and realized the Unity package was somehow not installed (even though said it did earlier). Then I found this and it solved my issue entirely. Make sure to click the assign button after.


    K heres the original posting, just to keep it local to this forum thread, i’ve just read that this was tested a couple of days ago and seemed to work ok with the current versions ( as of start of Dec 2016)

    (Step 1) Firstly, as you probably have done already if using visual studio, is to set VS as your script editor of preference.
    within Unity if you go to Edit > Preferences , then External Tools…, and select your editor of choice from within the External Script Editor dropdown.


    if you now open a script that you have in Unity, this should launch Visual Studio with your script open.

    (Step 2) What we need to do now is to check that the Help.UnityAPIReference library is installed within VS.
    Within Visual Studio, if you go to Tools > Options.

    (For users of Unity 5.2 and up, these Visual Studio 2015 Tools should already come as part of the installation.)

    within the options window that opens, from the left hand side listings, under the Environment group, select Keyboard.

    you will now see on the right, some keyboard mapping options.
    To check that the API reference help is installed, enter ‘Unity’ in the ‘Show Commands Containing’ text entry box. you may see something like the following.




    Pasted image758x441 45.8 KB


    if you see the Help.UnityAPIReference there, great, skip to Step 4, otherwise Step 3 will show you how to get this installed.

    (Step 3) installing Microsofts UnityAPI helper libraries if you dont have them.
    Microsoft have supplied these Visual Studio Tools for Unity at the following URL.
    Visual Studio 2015 Tools for Unity 23 (be aware that there are separate downloads for different VS versions)
    follow their notes for installation, and have a read of the section pertaining to Unity 5.2+ users.

    (Step 4) relaunch a script from Unity to load up Visual Studio and go back and open the keyboard mappings as shown in step 2 to bring the window back up.
    re-enter Unity in the ‘Show Commands Containing’ box on the right, and select ‘Help.UnityAPIReference’.

    To allocate the CTRL + ’ shortcut that you are familiar with.click your mouse in the ‘Press Shortcut Keys’ box. this should now have focus with a blinking cursor.
    Now press your key combination that you want. ie press CTRL and the ’ key together, and this shortcut key combination should show in that box. if it shows the combination you want, you can click on the Assign button and this will map the keys to that APIReference help.




    Pasted image758x441 14.4 KB


    Now if you close that window and return to your script, the CRL+’ shortcut will now bring up the API Reference like you are used to within MonoDevelop.

    The only thing that you will notice now, is that it doesnt open in your external browser window, but in a visual studio tab. if you like it this way, great, job done.

    If you would like this to open in an external browser window then do the following within Visual Studio.

    select Tools > Options, scroll down to find Tools For Unity, select General.
    in that window, you will see an option for Documentation, you can now change the option there for Use External Browser to true and then press OK to return to VS. like below.


    Pasted image758x441 15 KB


    This should work just like Mono does now with regards to the scripting search, hope that helps someone out.

    Again, any issues with this, let me know and I’ll attempt a fresh install with the latest versions to test again and update.

    PS**** I would highly suggest using the External Browser = True so it doesn't open in visual studio. Its extremely slow for me even though I can run Unity with 0 lag, delay, or issues. It doesn't seem to support browser loading well hysterically.


    (Copied from another site. If need assistance feel free to add and message me on Discord Tree'sInThePark#9293)
     
    Last edited: May 28, 2018
  24. iEXCEEDi

    iEXCEEDi

    Joined:
    May 26, 2018
    Posts:
    2
    Check my answer. Worked for me finally after trying everything above. Started from Step 3/4 for me.
     
  25. guetta18

    guetta18

    Joined:
    Jul 24, 2018
    Posts:
    19
    there is a way to connect also vs-code ?
    i dont want to install vs 2017 ...
    vs-code is light and its exactly what i need. so...
    any idea ?
     
  26. Rafellus

    Rafellus

    Joined:
    Apr 11, 2019
    Posts:
    1
    Flashheart8 likes this.
  27. Flashheart8

    Flashheart8

    Joined:
    May 21, 2018
    Posts:
    5
    Works Well and the interface is Great.
    Thanks for this

    Also, the setup instructions are here:
    https://code.visualstudio.com/docs/other/unity

    As usual windows likes to hide the .exe file in the secret folder tomb:
    C:\users\{username}\AppData\Local\Programs\Microsoft VS Code\Code.exe

    Once setup, the CTRL + ' to bring up the UNITY API help works as intended
     
    Last edited: Aug 17, 2019
  28. angryITGuy

    angryITGuy

    Joined:
    Apr 16, 2020
    Posts:
    3
    Late to the party, using VS 2019 Community edition, and I followed the above like this :
    1. Launch VS from Unity
    2. Tools->options
    3. Environment -> Keyboard
    4. Select "Default" keyboard mapping scheme.
    5. then searched for "unity"
    6. Select "Help.UnityAPIReference"
    7. Selecting Alt-F1 keys to assign Unity API help (Alt-F1 hasn't been assigned, Ctrl-H conflicted with other key mappings)
    8. Press Assign..
    9. Write some Unity code, have cursor on Unity API code, press Alt-F1 to test...
     
  29. efgt1995

    efgt1995

    Joined:
    Feb 20, 2020
    Posts:
    2
  30. DG_Sir

    DG_Sir

    Joined:
    Jun 5, 2023
    Posts:
    1
    I found a solution that worked for me, this issue was the shortcut key was already assigned to Nvdia. To disable it press Alt + z to open the GeForce overlay and go to setting>keyboardshortcut and find the Ctrl+Alt+M assigned box and set it to None or anything else.

    This might only work if you have Nvidia GPU, or check if the shortcut key is assigned to other applications. ✌
     
  31. Vasileios_P

    Vasileios_P

    Joined:
    Dec 30, 2019
    Posts:
    6
    Works perfectly! can't thank you enough...
    For your ease of use, i set the shortcut for "Help.UnityAPIReference" to "Ctrl+Shift+R" (R for Reference so its easy to remember) and its a shortcut that is not used. :)