I’m fairly new to C++ with UE5. I did a lot of C# in Unity awhile back, so I know a bit about coding, but I struggle with using Visual Studio. Basically every time I try to do anything to my class, I’m met with this:
I made the horrible mistake of hitting “Revert” once, which deleted days of work, but the other buttons do nothing. Usually what happens is that I hit the live coding button in UE and it compiles correctly, then takes me to VS where it says it triggered a breakpoint. Then it pops this up. How do I code without making my project self-destruct every 20 seconds?
It looks like you are modifying code while vs is running, that would cause the popup you are experiencing. In my experience Edit and Continue rarely works with UE. Rather write your code then build and run.
How did you have days of work in the editor since last you restarted? You need to work on your processes, but I don’t understand how you even got to that point to offer any advice.
Do not change code while you’re running inside Debugger. You can use Live Coding or Hot Reload when you don’t have debugger running, but if you’re not actively debugging, don’t be in the debugger.
I don’t believe so, but I always run UE through VS. I usually use “Run without debugger”. If you alter the code while the debugger is running, then you’re going to break the debugger. The debugger can’t debug the live coding modules.
So do you choose the Development Editor option? what is the difference? I’m sorry if these are stupid questions, but every tutorial or class I find just uses Debug Editor and doesn’t explain why. Visual Studio gives me a headache.
oh, no, never use Debug Editor unless you’re really digging into something nasty.
That enables a lot of internal debugging things you’re probably not going to use unless you’re doing stuff with engine internals. Everything runs measurably slower in Debug Editor, too.
Development Editor is the usual configuration.
If you’re not actively wanting to use the debugger, just use Run Without Debugging, and you can use VS as an editor and use Live Coding to rebuild while running. Of course, if you make any changes like adding new classes or changing the structure of classes, you may have issues with Live Coding and need to close, rebuild, and restart. Although I’ve heard 5.x has made a lot of improvements in that department as well, I’m not using 5.x yet.
Thank you. I’m actually working right now, and I just started building the engine that way. Time will tell if it works, but you seem pretty knowledgeable and I’m certainly not so I trust you lol.
On actual projects I back stuff up every day, but in this case I was just following along with a C++ class, so I wasn’t really expecting that kind of issue. Now I know.