Has anyone ever gotten this to work? I’ve looked through all the available questions and examples on the internet & forum, but it stubbornly refuses
I wish to replace a long switch statement that selects functions after a timer has ended, which im doing using a hidden stored parameter
header…
UFUNCTION()
void PlayCutScene(FName TheCutSceneReference, int32 TheResumeFunctionReference);
implementation in timer callback using stored hidden parameter…
switch (MyFunctionResumeIndex)
{
case 0:
REF_REF->GetLevelController()->ResumeAfterCutScene();
break;
case 100:
break;
}
with something like this - I Understand from research that this cannot be a UFUNCTION here ???
void PlayCutScene(FName TheCutSceneReference, TFunction<void()> TheFunctionReference);
just so I can pass in the function as a reference - mainly for readability and as an exercise to improve my coding skills. This is easy in standard c++, but not unreal c++
Then I can call the function such as
PlayCutScene("INTRO", &LevelController::ResumeAfterCutScene);