Developer Notes

This issue has been closed as 'Won't Fix' due to an extended period of time without updates. If this issue is important to you please let us know by posting on the AnswerHub or UDN, and Epic will re-open the ticket for further review.

Description

If an actor that contains a delegate bound in code is duplicated after being placed in the level, the delegate for the duplicate will also trigger the delegate for the original as well.

Steps to Reproduce
  1. Open UE4 Editor (any Project)
  2. Create new class based on Pawn (MyPawn)
  3. Create new class based on ActorComponent (MyActorComp)
  4. In MyActorComp, add the following:
    above the UCLASS:
    DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnTicked, AActor*, Actor);
    

    inside the UCLASS:

    UPROPERTY(BlueprintAssignable)
    	FOnTicked OnComponentTicked;
    
  5. Add the following to MyActorComp.cpp inside the TickComponent function:
    OnComponentTicked.Broadcast(GetOwner());
    
  6. In MyPawn.h add include statement for MyActorComp
  7. Add the following to MyPawn.h:
    UPROPERTY(Category = Components, VisibleDefaultsOnly, BlueprintReadOnly)
    	class UMyActorComponent* MyActorComponent;
    
  8. Add the following to MyPawn.cpp inside the constructor:
    MyActorComponent = CreateDefaultSubobject<UMyActorComponent>(TEXT("MyActor0"));
    
  9. Compile Code
  10. Create blueprint based on MyPawn (MyPawnBP)
  11. Create blueprint based on MyPawnBP (PawnBP2)
  12. Open PawnBP2 and select the MyActorComponent component in the Components panel
  13. In Details panel, click the plus next to OnComponentTicked to add event node
  14. Wire exec pin of event node to print node and wire Actor pin to the InString pin
  15. Add instance of PawnBP2 to the level
  16. Hold alt and drag gizmo widget to create a duplicate instance
  17. PIE

Result:
Three messages are printed to the screen, 1)the message for the original instance 2)expected message for the duplicate instance 3) Copied message, also from the duplicate

Expected:
Expected message prints once for each instance of the blueprint

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Won't Fix
ComponentUE - Foundation - Core
Affects Versions4.10
CreatedJan 15, 2016
ResolvedJan 13, 2017
UpdatedFeb 5, 2017