Going through the FPS tutorial as I learn the engine. I’m having an issue where the code compiles but when going back to the editor it just doesn’t take the changes, even when re-compiling from the editor. Oddly If I open and close the blueprint based on the C++ class the changed code is then (sometimes) used.
Any tips on how to make this process more consistent. I’m spending a lot of time trying to figure out why my code isn’t working only to discover that Unreal isn’t actually using successfully compiled changes. Is there a cache not being cleared somewhere that I need to nuke or a setting I should change?
Have you tried simply running through Visual Studio, shutting down the editor when you stop debugging/testing your code, and not relying on Hot Reload for changes? If you’re using the Unreal VS extension, it makes things super simple.
You incur some lost time as you’re shutting down/re-opening the editor while you iterate, but you can at least be sure you’re using the latest game binaries and if you’re project isn’t HUGE it should only take a few seconds (assuming the Shader Cache is already pre-built).
I actually realized its not C++ that is failing to update. Its the project settings. E.g. In the FPS tutorial at one point they have you link a blueprint to the hud to the “Default”
HUD for the project. I did this. It would not show up. I tried everything I could think of, rebuilding, reloading, etc…
Then I added this to my gamemode:
HUDClass = AFPSHUD::StaticClass();
and bam it shows up.
BUT here is the odd part.
I commented that out:
//HUDClass = AFPSHUD::StaticClass();
And the hud still shows up in game. So its the project settings not updating. What can I do to make this work more consistently?