I encountered an issue in my project, so I created a new project to reproduce the bug. Below are the steps to reproduce the issue and the problem description:
-
Create a Blueprint Widget (BP_MyWidget).
-
Create a PlayerController class in C++ (MyPlayerController).
-
Create a Blueprint derived from MyPlayerController (BP_MyPlayerController).
-
In the constructor of MyPlayerController.cpp, use ConstructorHelpers::FClassFinder to find BP_MyWidget class.
-
In BP_MyWidget, call GetOwningPlayer->CastToBP_MyPlayerController blueprint node.
-
It works fine initially, but after restarting the editor, it gets stuck in an infinite loading loop.
Additional details:
-
The editor usually gets stuck at 75% during startup, showing ‘Compiling blueprints…’ message. Sometimes the message varies, but it consistently halts at 75%.
-
The issue occurs even if EventConstruct and Cast nodes are not connected in the screenshots.
-
Casting to MyPlayerController instead of BP_MyPlayerController prevents the issue. This suggests the problem arises when casting to the derived Blueprint class.
-
The engine version is the latest release version at the time of writing, UE 5.4.2.
I wanted to report this as a bug, but I’m not sure if it’s due to my inexperience with Unreal Engine. Also, not getting any error messages makes it challenging to debug. I’m looking for guidance on how to address this issue.
Most importantly, I want to ask if there are any appropriate solutions or design practices to avoid causing this issue.
Thank you for your time and assistance.