Make changes to code without restarting editor?
Hi all, I am very new to Unreal Engine. I am a bit confused as I have completed the first lesson in programming for the engine. My issue is: When I make a change in visual studio to my classes, I must close the editor, build the solution in visual studio, then re-open the editor for changes to be applied. I've tried using "compile" in the editor but changes are not reflected. When I try to build in VS while editor is open, build fails. Any help will be greatly appreciated. Thanks in advance.
asked Mar 24 '14 at 10:07 PM in C++ Programming
Okay, this is a known limitation that we are working on for a future release.
Good news! There is an easy workaround!
Instead of compiling using Visual Studio, please click the "Compile" button on the editor toolbar. That will automatically save your code and initiate a compile right from within the editor, and automatically reload your changes afterwards.
We are still working on support for "hot reload" from within Visual Studio. Keep an eye out in future releases!
answered Mar 26 '14 at 04:04 PM
If you are making some new functions you have to close the editor and build it from VS, but if you are only editing some existing function just compile from the Unreal Editor toolbar..
answered Mar 26 '14 at 06:24 PM
You have to close the Editor only if you add new Classes, Functions, Properties or other C++ code with attributes(macros) such as UCLASS() and UPROPERTY(). This is because these attributes add reflection abilities to the Classes, Functions or Properties. In order for the Editor to refresh itself and be able to use the reflected new C++ code, it needs to restart. However, if you add any C++ code without attributes(macros) you can freely compile in VS and it will compile successfully. You simply say "I don't want the Editor to be aware of the new C++ code I just wrote". Unfortunately this way you won't be able to call a function in a Blueprint for example, because the function is not reflected and the Editor doesn't know that such a function exists. You won't be able to use any code in the editor, but that doesn't mean that the code won't do it's job. I personally like the Blueprint scripting, but I prefer to do everything from code (Call me an old-school guy :D). Anyway, this is how I understand this concept, so I may not be entirely right.
You can learn more about the attributes(macros) in this blog post and how they add reflection abilities to the C++ code.
answered Jun 22 '14 at 03:18 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here