Hi!
I’m using Unreal 5.3.2.
I had this delegate:
DECLARE_DELEGATE(FOnStopDelegate);
But I have changed the declaration with this one:
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStopDelegate);
And this has changed also:
public:
UPROPERTY(BlueprintAssignable)
FOnStopDelegate OnStop;
I have changed the binding, but I don’t know how to change the UnBind()
void UTBlocksSpawnerSubsystem::CreateFallingBlock()
{
FVector StartLocation;
if (GetFallingLocation(StartLocation))
{
CurrentFallingBlock = Cast<ATBlock>(GetWorld()->SpawnActor(BlockActorClass, &StartLocation));
if (CurrentFallingBlock)
{
CurrentFallingBlock->OnStop.AddDynamic(this, &ThisClass::BlockStopped);
}
}
}
void UTBlocksSpawnerSubsystem::BlockStopped()
{
UE_LOG(LogTemp, Warning, TEXT("BlockStopped - %s"), *FDateTime::Now().ToString());
CurrentFallingBlock->OnStop.Unbind();
}
How can I change CurrentFallingBlock->OnStop.Unbind();
to use it with a Multicast delegate?
Thank you.