As the error says, you cannot have static pointers as a UPROPERTY, as you mention - removing the static would allow you to set the property and modify it via blueprints (and you can grab that pointer in C++ as well once PostLoad/PostInitializeComponents is called). So, I’m not sure what the issue here is.
What’s the best way to do what I want then? Since the Engine doesn’t allow me Static Uproperties…
I have a Widget which is basically a progress bar.
Each object of my class (Actor-derived) will have a **different progress value **(one may be 40% completed, the other 10%, etc…)
Sincerely I think it’s stupid to create as many Widget instances as the number of objects…
For this reason I wanted a reference to the Widget so that the Widget that spawns in the game is just ONE, and it’s value (progress value) is changed everytime the player interacts with a specific object.
You basically have three options that I can think of:
1.) Just do a Widget per Actor and see if it becomes a performance issue.
2.) Dynamically instantiate / destroy the Progress Bar when the player interacts with the object, you could do this entirely through Blueprints or C++.
3.) Put the UPROPERTY on something that you know you’ll likely only ever have one of (e.g. The Player, GameMode) and then have your object get that UPROPERTY through Blueprints/C++.