Actors getting duplicated in PIE in some cases

In some cases, when going in PIE, some actors are duplicated (same GUID) and receive their “BeginPlay” on the 2 separate instances. This causes issues for systems which assume that only one instance of an actor can exist at a given time (based on the name of the actor). I added a screenshot of the outliner showing on my side the issue I am seeing.

Thank you!

[Attachment Removed]

Steps to Reproduce
With a world partition map (default hash set mode), do the following:

  1. Create an actor blueprint containing a cube for instance and drag n drop it in the world partition map somewhere close to the player start to make sure it is loaded when going in PIE.
  2. Make sure the actor is “Spatially Loaded” to true (but the other way around also has the same issue).
  3. Save the world.
  4. Go in PIE, at this point, look at the outliner, you will only have one instance of this actor loaded which is fine.
  5. Stop PIE.
  6. Select the actor and change its “Spatially Loaded” flag to false.
  7. Save the world.
  8. Go in PIE again, at this point, everything is still fine and you only have one instance of the actor.
  9. Stop PIE.
  10. Change the “Spatially Loaded” flag back to “true”.
  11. Save the world.
  12. Go in PIE, but this time, you will see that the actor is there twice in the outliner with the same GUID and 2 instances of this actor have been initlaized (ie, “BeginPlay”).

This issue is not permanent since closing the editor and reopening the editor fixes the issue.

[Attachment Removed]

Thank you Rafael for confirming the issue! We will wait for the proper fix and I will inform our team about the issue.

[Attachment Removed]

Hello [mention removed]​

Thank you for reaching out.

I’ve been assigned your case and will look into it.

All the best,

[mention removed]​

[Attachment Removed]

Hello [mention removed]​

Thank you for the detailed repro steps.

I was able to reproduce the issue.

I’ll investigate some more before opening a ticket.

As you mentioned, opening and closing the Editor avoids the duplicate, and I’ve noticed that reloading the level also removes the duplication.

Is this issue blocking you, or are you ok just opening and closing the Editor or reopening the scene for now?

Let me know.

All the best,

[mention removed]​

[Attachment Removed]

Hello [mention removed]​

Thank you again for reaching out.

I’ve been analyzing this issue, and I believe you’ve found an edge case: cycling bIsSpatiallyLoaded left the Editor in a state where the Actor was being duplicated from the Level into PIE and also spawned by the Streaming Manager, effectively behaving as both spatially and non-spatially loaded.

I’ve logged the Actor on BeginPlay and noticed it fires twice, but, although both have the same ID, they live in different levels:

LogBlueprintUserMessages: [BP_ReproActor_C_UAID_C87F5463DA3888AC02_1894905064] BP_ReproActor
 
LogBlueprintUserMessages: [BP_ReproActor_C_UAID_C87F5463DA3888AC02_1894905064] /Game/Maps/UEDPIE_0_ReproMap.ReproMap:PersistentLevel
 
LogBlueprintUserMessages: [BP_ReproActor_C_UAID_C87F5463DA3888AC02_1894905064] BP_ReproActor
 
LogBlueprintUserMessages: [BP_ReproActor_C_UAID_C87F5463DA3888AC02_1894905064] /Memory/UEDPIE_0_ReproMap_7EBELIVHKYDQQSMN1DE5MJVGW.ReproMap:PersistentLevel
 

I’ve made a JIRA report at: Unreal Engine Issues and Bug Tracker (UE\-358608)

Please note that it can take some time to be made publicly accessible.

We don’t provide updates on EPS, but if you would like to track the resolution, check the link for the status.

Regarding workarounds, I suggest either avoiding the swapping of bIsSpatiallyLoaded or being mindful to always flush the state by reopening the level or closing and reopening the Editor - at least until a definitive fix is out.

Let me know if this is helpful.

All the best,

[mention removed]​

[Attachment Removed]