AddToViewport() in Unreal 5.0.2 requires an int param

For the lesson Simple Shooter: Displaying a Lose Screen:

Maybe it’s just me, but when I implemented the LoseScreen->AddToViewport(), I got the error that AddToViewport() is not part of UUserWidget.

When looking at the source in UserWidget.h, the AddtoViewPort is slightly different:
void AddToViewport(int32 ZOrder = 0);

When adding a 0 to the call, it fixed the issue.

Privacy & Terms