Hello!
How to call a function from level blueprint inside c++?
I have function in level blueprint:
http://joxi.ru/Vm6ylvgUxvzB1r.jpg
And C++ code:
.h
UFUNCTION(BlueprintCallable, Category = Menu)
static void CallTimeUpMenuFunction(AActor* actor);
.cpp
void AGHTimer::TimerBody()
{
AGHTimer::Time--;
if (AGHTimer::Time == 0)
{
CallTimeUpMenuFunction(this);
}
}
void AGHTimer::CallTimeUpMenuFunction(AActor* actor)
{
FOutputDeviceNull ar;
actor->GetLevel()->CallFunctionByNameWithArguments(TEXT("ShowTimeUpMenu"), ar, NULL, true);
}
And this doesn’t work. Menu not showing
What is the problem?