How to Debug game code?

I’m working on code for an actor class and want to run the debugger through it to see if the functions work properly. Problem for me is I’m still not 100% used to Visual Studio and Unreal, and there are these different solution configurations, namely DebugGame and DebugGame Editor, and I don’t know which one would help me with this.

Debug and DebugGame works the best with debugging, Editor means it’s a editor build without it it’s game only, in order for your code module to work in editor you need to do editor build. Also get engine from source and build it in Debug configuration too, you might have a problems if not. Laucher version is “Development” build, you can debug on it to but sometimes it will show strange things when you try to read variable states.

So when you have breakpoints on some lines DebugGame Editor is what you use when you want to go through them in the editor?

If you want to debug using Visual Studio, you’ll need to run the project in Debug through Visual Studio or manually attach Visual Studio to the editor’s process. To do this, you can right-click the project in the Solution Explorer and select Debug > Start New Instance. This will take a moment but it’ll start the project in the editor. From this point, Visual Studio will be attached to the process itself and display information. If you set a breakpoint beforehand and it reaches that point in the code, it’ll immediately stop and Visual Studio will show you the breakpoint’s location.

Hope this helps!

Yeah it helps my problem, but does it always take awhile for it to start?

It should take a few moments for Visual Studio to prepare and then the normal time for the project to launch.

Start New Instance not available in VS2015. Isn’t it attach to process, and hten you select UEEditor.exe?

This screenshot is taken inside of Visual Studio 2015, so you should be able to start a debug instance this way. Starting and then attaching works as well however, so either way you would like to do it is fine.