When I build my code in visual studio, it doesn't effect Unreal.... (Issue)


I am having issues with compiling my code and it taking effect with Unreal. So i would write my code then build it by right clicking my project’s name in the solution explorer and hit build. It will build and show as there is no errors, but Unreal will not be effected. So I try again and nothing happens. Of course I will close Unreal and reopen it resulting in my code having taken effect. I have found that after about the second or third time me building in Visual Studio, Unreal will no longer Hot Reload leaving me to reload my project manually.

is anyone else having this issue? If so do you know of any fixes! THANKS!

Sorry if this has been answered before i couldn’t find that specific post if it exists.

Hi there BigBDayton!

This might be a silly question, but are you also clicking the “Compile” button in the engine? Each time you make changes to your code while the engine is open, you need to click that compile button. Hope this helps! Have a lovely day!

1 Like

For me the Compile button completely disappeared, and I haven’t been able to fix that yet…So I compile from Developers Tools > Modules. It’s actually pretty good since my own module is the only thing I change. If anyone has a solution to make the Compile button appear again…No idea how to build the link to VS back.

Could be a few things. First possibility is when you created the project you didn’t create the project as a c++ project:

Resolution to that is a bit annoying, but straight forward. Just create a new c++ project (basic code, or whatever template you need) and copy over any assets/scripts from your old project to your new c++ project.

If that isn’t the issue, you could try regenerating your project files. Just head to wherever your project is saved, right click your project solution file and click “regenerate project files”. Another instance where I’ve run in to my compile button not showing up is when I build my project + launch the engine from my IDE. I’ve started opening my project using the solution file (mentioned above) to launch the engine (kinda nice to not have to do this each time I build) then open up whatever files I want to work on from the engine. Not perfect, but since I started doing that I have yet to run in to the issue of my in-engine compile button going poof!

Hope this helps!

Unfortunately this feature gets buggy often. I had similar problems a few weeks ago, my project stopped hot reloading after I stopped a Rebuild in progress. Not even deleting the build files helped, but after I restarted my system everything went back to normal.

If you already did that, you might try File->Refresh Visual Studio Project in Unreal Editor and if this doesn’t help, cleaning/rebuilding the project is worth a try.

I find that making small code changes hot reloading always™ works. Adding new header files to the list of includes or new classes seems to break it for me sometimes so I always reload the engine after these. I’ve lost track of the number of times i’ve been searching for bugs to then realise code changes haven’t come across.

Thanks for your help! I just tried but no changes. Project was created as a C++ blank code, the compile button only disappeared a few days ago when I changed the toolchain to use VS2019. Since then I reverted back to default VS2017 but it didn’t bring back the button. I also tried cleaning, rebuilding solution and regenerating the VS project files.

It’s a minor inconvenience, I’m pretty sure it will fix itself when I copy over to a new UE4.24 project, I’m still on UE4.23 for now and recompiling only the module works perfectly for what I need.

This might not work, but at least it worked for me. I deleted the .vs folder at the main project folder, that will “reset” default options for the VStudio project. Just keep in mind you’ll lose current opened tabs and maybe other stuff.