I’m trying to figure out how to make an Uproperty in a custom AHUD class to become visible in Editor.
Unfortunatelly, I have not found any answer about this question or any similar problem. My intent is to edit this variable in editor to inform an string.
class ARENAPROJECT_API AHtmlHUD : public AHUD
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="HUD Properties")
Above code looks correct. At least to show property in editor.
I’m guessing you might’ve forgot about setting your HUD class as default one in game mode/world settings?
See Game Mode and World Settings documentations for more info.
If you’d want to modify it in editor you’d have to use EditDefaultsOnly instead of VisibleAnywhere or BlueprintReadWrite instead of BlueprintReadOnly in UPROPERTY macro. First will allow you to modify it in default blueprint class, the second allows to modify it on runtime instance of your HUD.
As for this property not showing up in editor,
Are you using your native class in world settings or some blueprint that derives from it?
Also, how exactly you want to modify that property? In editor or at runtime?
I’m already using the custom class in world settings and had tried using these options, only the ‘EditDefaultsOnly’ I haven’t tried yet. I’m gonna try that one and give you a feedback soon.
I’m using a blueprint derived from that custom class and trying to edit that value in Editor using the blueprint derived.
Okay, then everything seems to be set up properly.
Sometimes when I modify header file while compilation is already running, the changes never make it to the binaries. In such case, even when I try to recompile project, it doesn’t see any changes. I have to modify header again to force it to be compiled again. Maybe that’s the case?
Finally, recompiling has worked but only after using BUILD > CLEAN PROJECT in Visual Studio. I believe that some built part was not being updated when recompiling and after this clean up it was correctly rebuilt.
Thank you very much