Events from an actor reference variable do not account for changing the reference variable

I have encountered unexpected behavior using events provided by reference variables. If a reference is set within the editor, events linked to that reference behave as expected. If a reference is set at runtime, the same events exhibit unexpected behavior.

To demonstrate, I have an Actor, RefEventTester. RefEventTester has an Actor reference type variable, ActorRef. RefEventTester uses ActorRef’s OnDestroyed event to execute some behavior.

RefEventTester is placed in a level with ActorRef pointing to some other Actor in the level. ActorRef’s Actor is destroyed, successfully triggering RefEventTester’s OnDestroyed(ActorRef) event. During runtime, ActorRef is changed to point to another Actor in the level. ActorRef’s new Actor is destroyed, but does not trigger the OnDestroyed(ActorRef) event.

In an alternate scenario, RefEventTester is placed in a level with ActorRef pointing to some other Actor in the level. During runtime, ActorRef is changed to point to a different Actor. The Actor that ActorRef used to point to is destroyed, executing RefEventTester’s OnDestroyed(ActorRef), when it should not.

Here is RefEventTester’s event graph, which exhibits the first scenario:

Finally, here is the output generated by RefEventTester doing its thing, demonstrating that OnDestroyed(ActorRef) is only triggered once:

59977-output.jpg

I have also provided [a simple level][4] to demonstrate the behavior.

Hello Troglyfe,

I was unable to use the assets provided. I have a couple of questions for you that will help narrow down what issue it is that you are having.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. Could you provide the entire project that contains the assets that were share before?

Hello Rudy.

  1. Yes

  2. Here’s the project.

Thanks for looking into this!

Hello Troglyfe,

I was able to reproduce your issue on our end. I have written up a report ( UE-21489) and I have submitted to the developers for further consideration. I will provide updates with any pertinent information. Thank you for your time and information.

Make it a great day