Pelaculi
(Pelaculi)
April 25, 2023, 12:25pm
1
Hi, I am not having any problems, though i would like to know how do i execute something in the blueprints when a RepNotyfy function is executed in c++
Here’s an example of what i want to achieve:
UPROPERTY(ReplicatedUsing = foo)
float Number;
UFUNCTION()
void foo();
How do i get to execute something in the blueprints at the same time foo() is executed?
GarnerP57
(GarnerP57)
April 25, 2023, 8:48pm
2
Either make a BlueprintAssignable Dynamic Multicast Delegate or a BlueprintImplementableEvent and broadcast/call it within foo.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FFooDelegate, float, number);
UPROPERTY(BlueprintAssignable)
FFooDelegate OnFoo;
UFUNCTION(BlueprintImplementableEvent)
void ReceiveFoo(float number);
UPROPERTY(ReplicatedUsing = foo)
float Number;
UFUNCTION()
void foo()
{
OnFoo.Broadcast(Number);
ReceiveFoo(Number);
};