For each loop widget

It’s sort of a sloppy / lazy way of doing things. It should be safe to just Get element 0 from the array since it’s the MainWidget and only 1 instance should ever exist…

Ideally you’d have a proper widget reference stored in one of the globally accessible classes like Game Mode or Game Instance and cast to obtain it. Or even better, use a dedicated widget manager object that keeps tracks of what’s valid and not - this is invaluable as the project grows in size.

In case more than 1 instance of MainMenu ever gets created that loop becomes a potential game breaker as you can no longer be certain which MainMenu widget is assigned to that variable.

If you’re 100% sure you create the widget once only, it should be safe to use the code as is. Still, feels sloppy.