Hey there!
I have this custom blueprint player controller class with these events:
This blueprint class inherits from a C++ class. I want to move their declaration to the C++ class, but I have no idea.
How can I declare them in C++?
Thanks.
Hey there!
I have this custom blueprint player controller class with these events:
This blueprint class inherits from a C++ class. I want to move their declaration to the C++ class, but I have no idea.
How can I declare them in C++?
Thanks.
I have moved all the event dispatcher to a C++ class:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMoveActionDelegate, float, ActionValue);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSpeedUpActionDelegate);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnRotateActionDelegate);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnEnableRunCodeButtonDelegate);
/**
*
*/
UCLASS()
class TETRIS_API ATCommonPlayerController : public APlayerController
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintAssignable)
FOnMoveActionDelegate OnMoveAction;
UPROPERTY(BlueprintAssignable)
FOnSpeedUpActionDelegate OnSpeedUpAction;
UPROPERTY(BlueprintAssignable)
FOnRotateActionDelegate OnRotateAction;
UPROPERTY(BlueprintAssignable)
FOnEnableRunCodeButtonDelegate OnEnableRunCodeButton;
};
Then, I have created a BP class that inherits from ATCommonPlayerController
. On this new Blueprint class, I want to do this with the C++ event OnMoveAction
:
But I can’t. This is what I get when I try to call it:
How can I call it from blueprint?
I did it changing BlueprintAssignable
with BlueprintCallable
:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMoveActionDelegate, float, ActionValue);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSpeedUpActionDelegate);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnRotateActionDelegate);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnEnableRunCodeButtonDelegate);
/**
*
*/
UCLASS()
class TETRIS_API ATCommonPlayerController : public APlayerController
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintCallable)
FOnMoveActionDelegate OnMoveAction;
UPROPERTY(BlueprintCallable)
FOnSpeedUpActionDelegate OnSpeedUpAction;
UPROPERTY(BlueprintCallable)
FOnRotateActionDelegate OnRotateAction;
UPROPERTY(BlueprintAssignable)
FOnEnableRunCodeButtonDelegate OnEnableRunCodeButton;
};