Wtf is this error?

Soooo, one more question. When I build or compile my project, everything is ok, but when I test my function in game, it crashes and gives me this:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000448

UE4Editor_MyProject_0010!AMyCharacterCPP::Use() [C:\Users\keyni\Documents\Unreal Projects\MyProject\Source\MyProject\MyCharacterCPP.cpp:152]
UE4Editor_Engine!FInputActionUnifiedDelegate::Execute() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h:288]
UE4Editor_Engine!UPlayerInput::ProcessInputStack() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1384]
UE4Editor_Engine!APlayerController::ProcessPlayerInput() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2536]
UE4Editor_Engine!APlayerController::TickPlayerInput() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4555]
UE4Editor_Engine!APlayerController::PlayerTick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2184]
UE4Editor_Engine!APlayerController::TickActor() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4707]
UE4Editor_Engine!FActorTickFunction::ExecuteTick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:172]
UE4Editor_Engine!FTickFunctionTask::DoTask() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284]
UE4Editor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:886]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:710]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:602]
UE4Editor_Core!FTaskGraphImplementation::WaitUntilTasksComplete() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:1532]
UE4Editor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:564]
UE4Editor_Engine!FTickTaskManager::RunTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1585]
UE4Editor_Engine!UWorld::RunTickGroup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:785]
UE4Editor_Engine!UWorld::Tick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1494]
UE4Editor_UnrealEd!UEditorEngine::Tick() [D:\Build\++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1736]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [D:\Build\++UE4\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:426]
UE4Editor!FEngineLoop::Tick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4921]
UE4Editor!GuardedMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:178]
UE4Editor!GuardedMainWrapper() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
UE4Editor!LaunchWindowsStartup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:273]
UE4Editor!WinMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:320]
UE4Editor!__scrt_common_main_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

What I want to do:
when I look on door in game and click ‘E’, Widget has to play animation of fade, I have to telport to another side of door, and play animation in Reverse mode.
Here is line with problem:

FadeWidget->PlayAnimation(FadeWidget->FadeAnim, 0.0, 1, EUMGSequencePlayMode::Forward, 1.0);

FadeWidget here is reference to widget, and FadeAnim is variable, signed in this 2 lines in CustomUserWidget.h(class of FadeWidget):

UPROPERTY(BlueprintReadWrite, Transient, meta = (BindWidgetAnim))
		UWidgetAnimation* FadeAnim;

And also this is animation in Designer tab of BP class, based on CustomUserWidget.h:

Hope that’s enough to solve my problem, but if you want something else, you’re welcome.

Thanks in advance.

If this is the line that fails, then probably FadeWidget is nullptr here
Do you have any checks if FadeWidget is valid before you call the function on it?

1 Like

Yeah, I understood, that the problem is that FadeWidget equalls nullptr.
Here is the line with creating FadeWidget:

FadeWidget = CreateWidget<UCustomUserWidget>(GetWorld(), FadeWidgetClass);

FadeWidgetClass is signed in header of Player Controller this way(I found it in one tutorial, thought it will work):

UPROPERTY(EditDefaultsOnly, Category = "Widgets")
		TSubclassOf<UUserWidget> FadeWidgetClass;

In game it doesn’t create widget, and after closing window with game there is error message in the Message Log:
Abstract, Deprecated or Replaced classes are not allowed to be used to construct a user widget. CustomUserWidget is one of these.
So, what’s the problem with this line? How can I fix it? Sorry, I’m new into Unreal, so Idk many things.

Your class is UUserWidget, but you’re trying to create UCustomUserWidget;
Make it
FadeWidget = CreateWidget<UUserWidget>(GetWorld(), FadeWidgetClass);

1 Like

It says a value of type "UUserWidget *" cannot be assigned to an entity of type "UCustomUserWidget *"

Is FadeWidget in .h file declared as UCustomUserWidget* FadeWidget?
If so, change it to UCustomUser* FadeWidget as well.

maybe you wanted to say UUserWidget* FadeWidget?
But if I’m right, I will not be able to use UCustomUserWidget’s FadeAnim BindWidgetAnim.

Yeah, sorry, deleted the wrong word =)

What is UCustomUserWidget anyway? I can see it’s mentioned here and there on the Internet, but I can’t find it neither in the official documentation nor in the source cpp classes.

Or is it a class you created yourself?

Yeah. Do you need anything from it?

Ah, okay, it’s your own class, it makes sense now.
Then use it in every spot you have.
.h:

UCustomUserWidget* FadeWidget;
TSubclassOf<UCustomUserWidget> FadeWidgetClass;

.cpp:
FadeWidget = CreateWidget<UCustomUserWidget>(GetWorld(), FadeWidgetClass);

1 Like

It says CreateWidget called with a null class about FadeWidgetClass. That’s why it skipped line with playing animation. How can I fix it, and why is it problem?