I currently have a UClasswhich has two functions, DoAction and ActionTick, both of which are BlueprintImplementableEvents.
UCLASS(Blueprintable)
class MY_API UAction : public UObject
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Execute"))
void DoAction(AAgent* ActingAgent, AMyGameMode* CurrentGameMode);
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Tick"))
void ActionTick(AAgent* ActingAgent, AMyGameMode* CurrentGameMode, float DeltaTime);
};
An agent starts with a default UAction. This is just the C++ class, and not a blueprint class.
UAction* CurrentAction = NewObject<UAction>();
When ActionTick is called on CurrentAction the editor crashes with an access violation.
CurrentAction->ActionTick(this, static_cast<AMyGameMode*>(GetWorld()->GetAuthGameMode()), DeltaTime);
When debugging the violation occurs in UE4Editor-CoreUObject.dll!UClass::FindFunctionByName(FName InName, EIncludeSuperFlag::Type IncludeSuper) Line 4095 C++
If I try to step into that line I get the access violation. In the debugger InName is set to “Variable is optimized away and not available.”
I’m currently testing to see if I can set a default blueprint instead of c++ class.