Unreal Engine 4.9.1
I have such problem:
My menu is builded with component cubes and component widgets. All of this is inside One Actor (C++ -> Blueprint).
Every button have widgets component with field of own ‘Widget Class’. Every widgets class is made manually (Widget Blueprint or C++ -> Widget Blueprint).
My menu should work when game paused. Now my menu work well without game paused. So I start upgrade my menu to work while game is paused.
I change every timer function (which dont work while paused) to my own function with core inside actor whose ‘Tick Even when Paused’ is set to TRUE. Work well.
UMG classes set as ‘widget class’ of component widgets don’t update content while game is paused.
This link UMG Pause - UE4 AnswerHub inform that I can go around this problem, construct UMG widgets AFTER I set game paused.
I cannot destroy and create full actor because of light should be burned.
So now I’m trying to create widget component of actor:
a) I cant do this inside c++:
Dam = CreateDefaultSubobject<UWidgetComponent> (TEXT (“Dam22”));
Dam->RelativeLocation = FVector (220.0f, -50.0f, 0.0f);
Dam->RelativeRotation = FRotator (40.0f, 0.0f, 90.0f);
Ham = CreateDefaultSubobject<UWidgetComponent> (TEXT ("Ham22")); Ham->SetOnlyOwnerSee (true); Ham->AttachParent = Dam; Ham->RelativeLocation = FVector (220.0f, -50.0f, 0.0f); Ham->RelativeRotation = FRotator (40.0f, 0.0f, 90.0f); Ham->SetWidgetClass (UTheMenuRightImages::StaticClass()); I see this widgets inside unreal editor, but function CreateDefaultSubobject work ONLY in constructor. So I cannot make this way widget in controlled way every time after I set game pause.
b) Another possibility is to create widget component of specified class inside blueprint. So I’m trying to do that, but without any effect. I’m trying to create widget component inside menu actor blueprint.
“Add Widget Component” in space screen (which I dont wont) is create while game paused well. When I change parameter space to world, I see nothing when creating while game paused. I test it also not while paused - and the same node “Add Widget Component” in space world create widget well. Example class of this widget component is TestUI which only have Image widget with static brush.
c) Maybe widget created dynamically after set game paused to true can be done inside UMG. So then I create in blueprint by “Add Widget Component” and then “Add to Viewport” Panel’s and Images UMG, but without any success. Widgets created after set game paused to TRUE, don’t work - I don’t see anything.
What is the possibility to work with (change dynamically content) UMG while game is paused ???