Using VS 2022, Unreal Engine 5.1.
I’m sort of losing my mind trying to figure out a proper way to Call Events in CPP, just as like in Blueprint. I created this Custom Event. But when I tried compiling it, I had an error that it’s “already defined”. Only adding the implementation in cpp. to it kinda fixed it, and allowed me to Compile it.
But I’m not sure if it’ll work as intended, cuz for Header it says “Function Definition Not Found”. Plus the issues with “initializing” the variables.
Can I like… get to know if I did it right or what’s this all about?
HEADER h.
public:
// #CUSTOM EVENTS START
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Multi-Action Events")
void CE_MAIA_Special();
// #CUSTOM EVENTS END
CPP.
// Sets default values for this component properties
UMultiActionInput::UMultiActionInput():
// Initialize Default Values
MAIA_Current (EPlayerMAInputAction::MAIA_Special),
MAIT_Current (EPlayerMAInputType::MAIT_Hold),
MA_InputTap (false),
MA_InputWheel (false)
{
// Set this component to be initialized when the game starts, and to be ticked every frame.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// #CUSTOM EVENTS START
void UMultiActionInput::CE_MAIA_Special_Implementation()
{
MAIA_Current = EPlayerMAInputAction::MAIA_Special;
}
// #CUSTOM EVENTS END