Hi, I am currently porting my UE 4.27 game to UE 5.2. I have most issues worked out, but I stumbled on something new when building a shipping version for Mac: when the game window is resized, when switching from fullscreen to windowed, or when the resolution is changed, the game freezes. The freeze can last for several seconds or even longer, effectively crashing the game.
Trying to isolate the problem, I have determined:
The problem only occurs on Mac
It only happens in Shipping builds, packaged development builds are fine
It happens in 5.2 (launcher and source builds) and 5.3, but not in 4.27
It happens on M1, M3, and Intel MacBooks
The severity depends on the complexity of the scene. If I have only a single static mesh, the freeze is not noticeable. But with just a few dozen simple meshes, it can already take several seconds.
I can easily reproduce the issue in a new project: an empty proudct is too simple to notice the delay, but a shipping build of the âArchvisâ sample project takes more than five seconds to resize when pressing Option-Enter, even on an M3.
Does everyone run into the same problem, and is there a known workaround?
I have tried Fortnite and it doesnât have the same problem. Fortnite should be on UE5.3, so it is possible to get a shipping build without the freezes on resolution changes. Maybe a configuration setting somewhere? The Metal version doesnât seem to make a difference. Did no one else get this freeze on shipping builds?
Hi. Have you been able to solve the problem? I have the same issue when the window resize freezes the game Maybe its something related to project/rendering settings?
Unfortunately no, I havenât found a way to get rid of the freeze. I was forced to release updates with this as a known problem. I hope that future Unreal Engine versions will fix the problem, I havenât tried 5.4 yet.
Has anyone found a solution to this? It does seem to lag even on the base third person map whenever you try resizing the window⊠Upgrading to 5.4.2 does half fix it on mouse and keyboard, but if you change the resolution via a gamepad it freezes the window again⊠I wouldnât recommend upgrading though since it does mess with the textures you have, causing it to reset to albedo every time you open the editor.
So it looks like they did fix the bug but for UE version 5.1: Unreal Engine Issues and Bug Tracker (UE-180492). Theyâre also targeting the fix for 5.5, but they donât mention any fix for the other versions yet.
For anyone else having this issue please bump up this post so versions 5.2 - 5.4 can be fixed as well!
K so good news: I found a solution for this using UE5.3.2, however it requires building it from source. The solution to this bug looks like you would have to apply the bug solution (this git commit) to UE5.3.2âs source code by cloning and building it from GitHub and changing the code in the MetalViewport.cpp file as indicated through the changes in these two photos below (*Note: The line numbers shown here arenât one-to-one, so just try to compare the code to locate where to make these changes):
That said, this fix may be unattainable as I write this (Jan 2025), due to the awkwardness with building UE5 from source with Xcode 16.2, but hopefully this helps anyways.
Another solution would be to upgrade to UE5.5 through the Epic Games installer, however all things considered it seems that UE5.3.2 is the most stable release (for my project at least).
So TL;DR: unless we get a patch from Epic Games to UE5.3.2 that directly resolves this bug (i.e. UE5.3.3[?]), it looks like modifying UE5 from the source code is the best solution.
Quick unfortunate update: it looks like after applying the âfixâ above, changing resolution is fine for mouse and keyboard, BUT like I said here for upgrading to UE5.4, changing the resolution with a gamepad still freezes the game within process-heavy levelsâŠ
I also found out that the freeze starts, specifically if ApplyResolutionSettings is called at any time while a gamepad is being used in my main levels (outside of main menu), after making a timer to change game resolution 3 seconds after begin play in my main level.
And after some debugging with VSCode it looks like the issue stems from a file called:
After taking a look at the GitHub, it also seems that this is a current issue as of UE5.5, since it seems to process a âsemaphoreâ that is accessed through Xcode and through the âdispatch_semaphore_waitâ function, making it time-out over and over and executing an infinite do-while loop here, causing another freezeâŠ
I can assume that the Windows is able to handle âsemaphoresâ fine, because after researching functionality through looking in the source code on GitHub, there is a working and fully implemented WindowsSemaphore.h and .cpp file in the Runtime code for UE5, while the MacSemaphore.h and .cpp file was added two years ago to fix deprecation in Xcode, but is not made use of or implemented at all within CocoaThreads.cpp.
So, while I am happy that I can freely use my mouse and keyboard to change the resolution with the fix I described in the post above, thereâs still a bug in the source code that freezes the game when resizing the window or changing resolution settings with the gamepad in packaged (shipping) builds on MacOS (as of Jan 2025).