**New UMG Node for my Victory BP Library
Get All Widgets of Class
Ideal for UMG Level Transitions**
I needed this node for Solus and so I am now sharing it with you!
The issue was that I could not save a reference to my new widget because it is loaded and then a level change occurs which resets all my HUD variables.
So I needed to access the widget after it was created dynamically, not relying on stored references within the HUD class.
I also did not want to have to store a reference to it in my Game Instance class cause then that leads to garbage collection issues.
I had to make the node for my own use and I have tested it as working in Solus!
**Now you can retrieve an array of any type of UMG widget instances in your game at any time!
**Victory BP Library Download**
Here’s what my C++ for this node looks like!
void UVictoryBPFunctionLibrary::GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass, TArray<UUserWidget*>& FoundWidgets)
//Prevent possibility of an ever-growing array if user uses this in a loop
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
for(TObjectIterator<UUserWidget> Itr; Itr; ++Itr)
if(Itr->GetWorld() != World) continue;