Reference to UserWidget

Hi,
Hope you are doing fine.
I had a question. How can I get a reference to a UserWidget in my Player class in C++?
Note: User Widget is not attached to the player, by this I mean that widget component is not created on to the player. It is an inventory that is being shown in the viewport in GameMode using “CreateWidget and AddtoViewport”. I want to get a reference to this widget so I can access its members.
Thank You

If the game mode is storing it then you can just create a getter and get it from the player that way through GetWorld()->GetAuthGameMode<AYourGameModeHere>()

By this you mean, “MyGameMode->GetWidget;”???
After Successful casting.

If it’s public or you have a public getter which would probably be better.

1 Like

Thank You

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms