no play option in visual studio - unity3d

I am trying to print some text in console of unity but no text gets printed in the console. there is an option of attach to unity and play but even after clicking on it nothing gets displayed.

Are you not able to see the console printouts in Unity? Debug.Log("message") and/or print("message") should work. You need to enable your console to view them. Enable it by going to Window -> General -> Console in Unity, and enabling debug messages by selecting the message tab on the top left of the console window.
Here is how to enable your console.
Here is the tab you must select so debug logs or normal print messages are shown in the console log. The tab to the right of the messages are warnings and to the right of that are error messages.
Attaching Visual Studios to Unity when in play mode is only needed when you need to debug your code. It is especially useful when using breakpoints and walking through code to determine complex issues. If you have a debug print message in code, make sure the script is on a GameObject that is enabled and active in your scene. Once that is done, just hit the Play button in Unity.

Related

Whilst trying to use the VScode debugger, it opens for 2 seconds, closes, and I don't receive an error message

I am trying to debug a python file that I have in my VScode and whenever I press the play button for "Python: Current" I get a message in the terminal like this and I don't receive an error message. I am using macOS
brianw#BLT-3 VScode % cd "/Users/brianw/Desktop/Coding Projects/VScode" ; /usr/bin/env /usr/local/bin/python3 /Users/brianw/wpilib/2022/vscode/code-portable-data/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 51951 -- "/Users/brianw/Desktop/Coding Projects/VScode/Python-Code-Challanges/debugg.py"
I have looked almost everywhere on the internet and couldn't find a solution for over an hour. I tried to ask the chatGDP bot and it was no help, I did everything it said to troubleshoot, but nothing worked. I tried looking it up, but I got a troubleshooting problem that I couldn't fix, "Make sure that you have the correct Python interpreter selected in the VSCode settings. You can do this by going to the bottom left corner of the VSCode window, clicking on the Python icon, and selecting the interpreter you want to use." and then "In the search bar at the top of the Settings window, type "python.pythonPath" and press enter." but I searched it and nothing popped up.
Edit: The problem was the data was in a funtion and I didn't call the funtion
Steps to debug python code in vscode:
Go to the run and debug option in the side bar.
Click your current python file for debugging.
But the important step is to place a breakpoint in your program before starting to debug your code..
If you didn't place any breakpoints it will close automatically.

How to permanently hide Debug Console in VSCode?

I have looked for a solution but couldn't find one, recently I switched the Explorer in VSCode from the LHS to the RHS and it works better, the problem I am now having is that when I open the terminal I get a debug console on the left - see picture below.
Is there a way in which I can disable/hide the Debug Console part of the terminal? It is always maximized when I start a new console and I can't set it to minimize.
Either choose Reset Location in the context menu or just drag the Debug Console header back into the upper part of the Panel (like to the right or left of the Terminal header).
At some point you must have dragged the Debug Console header into the body of the Terminal (when Terminal was active and into the left half of its view).
You'll also notice that the option to Hide 'Debug Console' is disabled in your first situation - that is a hint of sorts - it is actually within the Terminal view and so cannot be separately hidden from its context menu.
Click on the debug tab and drag it to the top.

unnecessary shift of cursor to console log

I am using eclipse on Ubuntu. When there is log being shown in console and I am moving cursor up or down in JAVA file to see the code, the cursor shifts itself to the console log and and I am having problem to investigate my code. My cursor shifts to console log even if I disable the console view from windows-> Show View. Is there any way that I am not forced to see the console.
I just got rid of this issue. Right click in console window, select preferences and then unchecked the checkBox "show when program writes to standard out" and also unchecked the checkBox "show when program writes to standard error".

Eclipse Luna Console View - how to lock Console View to console output

In Eclipse Luna I opened two Console Views. I attached output from a external build tool to the first one and Liferay server output to the second one. Whenever I run the external build tool, both Console Views start to display the output of the external Build tool and I have to manually switch the content of the second Console View every time. Is it possible to bound the Console View with the specific output permanently? I did not find this feature in the Eclipse documentation.
If I understand your question, there is a button on the console window which is "Show console on any output":
Enable this button on the console you want to capture, and disable it and the button next to it, (which is "Show console on any error") for the console you don't want to show. This usually works for me on Luna SR1.
There is a button with a "+" sign on the top right. click it to open a new console.
Once you have two consoles, use the Pin console (console with a board pin icon on the top right) button to pin the newly opened console to the liferay server console.

Console window no longer appearing correctly

My console window is not longer baked into Eclipse. It appears as a seperate window which hovers over my any open project file windows. I don't know what I did to cause this. I've tried re-starting Eclispe, opening and closing the console view.
Screenshot attached
Found solution, right click on console window and un check "Detached" option.