BlueprintNativeEvent override Crash

I have no idea why all my attempts to override a BlueprintNativeEvent are not doing well.

Basically, after inheriting AGameModeBase class and overriding the method

UFUNCTION(BlueprintNativeEvent, Category=Game)
	AActor* ChoosePlayerStart(AController* Player);

by doing this:

virtual AActor* ChoosePlayerStart_Implementation(AController* Player) override;

I’ve got this crash log:

Crash Log
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4542]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1314]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\actor.cpp:693]
UE4Editor_Engine!AGameModeBase::ChoosePlayerStart()
UE4Editor_Engine!AGameModeBase::execChoosePlayerStart() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\classes\gameframework\gamemodebase.h:47]
UE4Editor_CoreUObject!UFunction::Invoke() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4542]
UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1314]
UE4Editor_Engine!AActor::ProcessEvent() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\actor.cpp:693]
UE4Editor_Engine!AGameModeBase::ChoosePlayerStart()
UE4Editor_Engine!AGameModeBase::execChoosePlayerStart() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\classes\gameframework\gamemodebase.h:47]

Accusing Stack overflow - code c00000fd (first/second chance not available)

I’m not sure what’s wrong, I’m using the same indentation as GameMode overriding GameModeBase method and my method just a Super call.

UFunction::Invoke() is causing loop.

void UFunction::Invoke(UObject* Obj, FFrame& Stack, RESULT_DECL)
{
	checkSlow(Func);

	UClass* OuterClass = GetOuterUClass();
	if (OuterClass->IsChildOf(UInterface::StaticClass()))
	{
		Obj = (UObject*)Obj->GetInterfaceAddress(OuterClass);
	}

	TGuardValue<UFunction*> NativeFuncGuard(Stack.CurrentNativeFunction, this);
	return (Obj->*Func)(Stack, RESULT_PARAM);
}

Well… right after posting it, I tested by removing the Super call and it has stopped crashing.

So, Super cannot be called in overriden BlueprintNativeEvent methods. Someone could explain me why? I really wanna know

Hey, I think I had the same problem as you… I’m trying to call a base class BlueprintNativeEvent function from a child class and am getting a stack overflow. I figured out if I call the _Implementation version of the function it works. Like this:

base.h

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Default")
void HideScreen();
virtual void HideScreen_Implementation();

base.cpp

void Base::HideScreen_Implementation()
{
	// Base class implementation
}

child.h

virtual void HideScreen_Implementation() override;

child.cpp

void Child::HideScreen_Implementation()
{
	Base::HideScreen_Implementation();
    // Child class implementation
}

I’m not sure if this is the correct way to handle it or not but it seems to work. Hope this helps!

1 Like