Description

The number of calls to the Event Dispatcher increase each time the blueprint actor containing the reference is compiled. This issue was not present in 4.18.3 (CL-3832480) but is in 4.19.2 (CL-4033788), 4.20 Preview 4 (CL-4154964), and Main 4.21 (CL-4156848).

Steps to Reproduce
  1. Open the Editor
  2. Create two Actor BPs. One named Controller_BP and the other Receiver_BP
  3. In Controller_BP create an Event Dispatcher named 'OnSpaceBarPressed'
  4. In the Event Graph add a 'Space Bar' node and a call to OnSpaceBarPressed. Connect 'Pressed' to to OnSpaceBarPressed.
  5. # In the Class Defaults of Controller_BP change the 'Auto Receive Input' to Player 0
  6. In Receiver_BP create a variable referencing Controller_BP. and set it to Instance Editable
  7. In the Construction script of Receiver_BP add the following logic: Connect an IsValid node to the Construction Script, use the Controller_BP variable as the Input Object, add a 'Get All Actors of Class' node, set 'Controller_BP' as the Actor Class, and connect it to the 'Is Not Valid' pin, drag off from the 'Out Actors' pin and add a 'Get' node, drag a set of the Controller_BP variable and connect it to the exec pin from 'Get All Actors of Class' and to the output of the 'Get' node.
  8. Using the Controller_BP variable add the Event 'OnSpaceBarPressed' and connect a Print String to it.
  9. Drag instances of both Controller_BP and Receiver_BP into the Viewport
  10. Play in Editor and press space bar, you will see one "Hello".
  11. Exit PIE, open up Receiver_BP and force a compilation of the blueprint
  12. Play in Editor and press space bar, you will see two "Hello"s
  13. Select your Receiver in the World outliner, in Details -> Default, click on Reset to Default arrow next to the Controller_BP variable.

Or

  1. Open up the attached project and Play in Editor
  2. Play in Editor and press space bar, you will see one "Hello".
  3. Exit PIE, open up Receiver_BP and force a compilation of the blueprint
  4. Play in Editor and press space bar, you will see two "Hello"s
  5. Select your Receiver in the World outliner, in Details -> Default, click on Reset to Default arrow next to the Controller_BP variable.

Results: Each time you compile your receiver, it increases the number of calls from the implementation of the event dispatcher by 1.
Each time you reset your variable, it sets it back to 1

Expected: The number of call should always be 1, independently of the number of compilation of the receiver.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-61155 in the post.

5
Login to Vote

Won't Fix
ComponentUE - Gameplay
Affects Versions4.19.24.204.21
CreatedJun 26, 2018
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue