I’ve encountered weird circumstances lately. I’ve created a class in C++ and applied UCLASS
macro on it. Inside this class, I created 5 static functions. All of these functions are UFUNCTION(BlueprintCallable, Category = "Helper")
. I’m able to use them properly in Blueprint (event graph and macros). It runs fine when I play it in PIE.
But whenever I created the sixth static function in C++ and also use UFUNCTION(BlueprintCallable, Category = "Helper")
, the Editor became unstable. Sometime it can appear normally like the other 5, in event graph and macro. But when I closed the UE editor and reload it, it show compilation error and the sixth function is undetected. I could easily close the UE editor, change the function name, rebuild the whole project in VS, and then reopen UE editor. It will then show this new function. I can use this function again normally. But it if I close the UE editor and reopen it, the same error keeps happening.
It seems like, the compiled static function in C++ is only available upon hot reload. But will be gone when the editor close. No matter how much I recompile or rebuild in VS, that function will be disregarded by UE editor. The only way to have UE editor recognize the sixth static function is by renaming it and recompile the source code. But it is only temporary upon hot reload. It’ll be gone again, after the UE editor closes.
Here’s an example of one of the static function (created in C++, but used in blueprint).
It is used to convert FColor
structure to FLinearColor
structure.
Is there some framework rule that I’m not aware of or is this a bug in UE editor?