CommonUI Plugin - UCommonBoundActionBar Not constructed during game pause

Hey guys. I have also ran into this unfortunate problem. I believe this issue exists because CommonUI is originally made for Fortnite, which is an online game, which was never meant to be paused, so this bug just slipped away.

I don’t think you can workaround this without modifying plugin’s code. In my case, I moved this call from next-tick timer to world’s tick start, which is functionally a very similar thing, just a little more code than that.

If anyone is interested in how exactly to make this work during pause, here’s what I did:

  1. We are going to modify following two files:
  • Engine\Plugins\Experimental\CommonUI\Source\CommonUI\Private\Input\CommonBoundActionBar.h
  • Engine\Plugins\Experimental\CommonUI\Source\CommonUI\Private\Input\CommonBoundActionBar.cpp
  1. Add this to header file’s private section:
void OnDisplayRefreshRequested(UWorld* World, ELevelTick TickType, float DeltaSeconds);

FDelegateHandle RefreshHandle;
  1. Add this function to .cpp file:
void UCommonBoundActionBar::OnDisplayRefreshRequested(UWorld* World, ELevelTick TickType, float DeltaSeconds)
{
	FWorldDelegates::OnWorldTickStart.Remove(RefreshHandle);
	HandleDeferredDisplayUpdate();
}
  1. Remove this timer creation in .cpp
GameInstance->GetTimerManager().SetTimerForNextTick(FTimerDelegate::CreateUObject(this, &UCommonBoundActionBar::HandleDeferredDisplayUpdate));
  1. And add this worldtick-based call instead
RefreshHandle = FWorldDelegates::OnWorldTickStart.AddUObject(this, &UCommonBoundActionBar::OnDisplayRefreshRequested);
  1. Compile and run. Now action bar should properly get constructed even when game is paused.
1 Like