[UE5 BUG] UI freezes the game/engine but only the first time after starting

Hey all,

This short YT-video shows my issue

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?

Best regards,
M

Could it be a shader compile issue? Is there any Niagara effects that play during the boulder / meteor impact?

You could try forcing a recompile of shaders via a console command:
recompileshaders all

No i dont use any effects yet. Maybe its some kind of null pointer :thinking: ?

a null pointer would lead to a crash. Are you perhaps resolving any type of soft class / soft object via async load while doing that action?

As far as i can see it right now iam not loading anything async. However i found some casts that may slow things down.

I also disabled the UI animation to check if some soundfile/image causes problems, but it didn’t change anything.

I will double check the possible async stuff and report back here

So i tracked down the function that is causing the issue:

Click here to see it online

If i remove the execution pin the lag has a length of ~ 0.01 seconds, wich may be caused by all the casts i do before this function.

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 :slight_smile:

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