Exspected behavior: Dont freeze or freeze every time the UI is shown in game.
Actual behavior: The game freezes the first time the UI is used after starting the UE5. The freeze length is between 2 and up to 10 seconds. After that everything works perfectly fine.
Suggestion: Some kind of resource isn’t loaded in time after starting the engine.
How do i make sure every png/soundfile/etc is loaded when starting the game?
Why not cache the game state cast to a variable at begin play and just never cast again past that point? Then there is no penalty on the function call.
Then call refresh on that variable.
Yea i also think the game state cast i causing most of the issue, because it may not be loaded in time. I will mark this as solved and report if i managed to fix this issue. Thx for pushing me in the right direction