Scene Graph - Prefab referenced entities still remain unique when placed into the main level

Summary

This is a follow up test of FORT-870988 which was meant to be fixed with 35.00, but it’s not fixed at all.

image


Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Stability

Steps to Reproduce

Code to reproduce the issue:

using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }

vz_test_bad_prefab_references_component := class<final_super>(component) {
  @editable
  DebugTitle: string

  @editable
  Entity_Reference_Set_In_Main_Scene: entity

  @editable
  Entity_Reference_Set_In_Prefab: entity

  OnBeginSimulation<override>(): void = {
    Print("----- '{DebugTitle}' Entity_Reference_Set_In_Main_Scene -----")
    Print(ToDiagnostic(Entity_Reference_Set_In_Main_Scene))

    Print("----- '{DebugTitle}' Entity_Reference_Set_In_Prefab -----")
    Print(ToDiagnostic(Entity_Reference_Set_In_Prefab))

    if (Entity_Reference_Set_In_Main_Scene = Entity_Reference_Set_In_Prefab) {
      Print("----- '{DebugTitle}' entity references are equal -----")
    } else {
      Print("----- '{DebugTitle}' entity references are NOT equal -----")
    }

    # Test uniqueness of those entities against other entity component
    if {
      Parent := Entity.GetParent[]
      Components := for:
        Component: Parent.FindDescendantComponents(vz_test_bad_prefab_references_component)
        Component <> Self
      do {
        Component
      }
      OtherComponent := Components[0]
      Print("----- '{DebugTitle}' found other component '{OtherComponent.DebugTitle}' -----")

      if (Entity_Reference_Set_In_Main_Scene = OtherComponent.Entity_Reference_Set_In_Main_Scene) {
        Print("----- '{DebugTitle}' Entity_Reference_Set_In_Main_Scene references with other entity are equal -----")
      } else {
        Print("----- '{DebugTitle}' Entity_Reference_Set_In_Main_Scene references with other entity are NOT equal -----")
      }

      if (Entity_Reference_Set_In_Prefab = OtherComponent.Entity_Reference_Set_In_Prefab) {
        Print("----- '{DebugTitle}' Entity_Reference_Set_In_Prefab references with other entity are equal -----")
      } else {
        Print("----- '{DebugTitle}' Entity_Reference_Set_In_Prefab references with other entity are NOT equal -----")
      }
    }
  }
}

Expected Result

The entities from a prefab should all be unique inside the main level, they should not share objects from the prefab as this is a source of bugs. Imagine an entity that needs some transform adjustment. With the given issue the transform adjustment from one placed prefab will affect the other prefab!

Observed Result

Similar to the previously reported issue, the results are the same:

----- 'A' Entity_Reference_Set_In_Main_Scene -----
Entity /676c5ab0-47a3-9405-4a80-88aec1efe452/vz_anomaly_3_LevelInstance_1.vz_anomaly_3:PersistentLevel.LevelEntity.LevelEntity.vz_test_prefab_6gdmjancco2o2_137055168.entity_6gdmjancco2o2_1784903058
----- 'A' Entity_Reference_Set_In_Prefab -----
Entity /676c5ab0-47a3-9405-4a80-88aec1efe452/vz_test_prefab.Default__vz_test_prefab_C:entity_6gdmjancco2o2_1784903058 ❌ UNEXPECTED
----- 'A' entity references are NOT equal ----- ❌ UNEXPECTED
----- 'A' found other component 'B' -----
----- 'A' Entity_Reference_Set_In_Main_Scene references with other entity are NOT equal ----- ✅ EXPECTED
----- 'A' Entity_Reference_Set_In_Prefab references with other entity are equal ----- ❌ UNEXPECTED


----- 'B' Entity_Reference_Set_In_Main_Scene -----
Entity /676c5ab0-47a3-9405-4a80-88aec1efe452/vz_anomaly_3_LevelInstance_1.vz_anomaly_3:PersistentLevel.LevelEntity.LevelEntity.vz_test_prefab_6gdmjancco2o2_609650586.entity_6gdmjancco2o2_1784903058
----- 'B' Entity_Reference_Set_In_Prefab -----
Entity /676c5ab0-47a3-9405-4a80-88aec1efe452/vz_test_prefab.Default__vz_test_prefab_C:entity_6gdmjancco2o2_1784903058 ❌ UNEXPECTED
----- 'B' entity references are NOT equal ----- ❌ UNEXPECTED
----- 'B' found other component 'A' -----
----- 'B' Entity_Reference_Set_In_Main_Scene references with other entity are NOT equal ----- ✅ EXPECTED
----- 'B' Entity_Reference_Set_In_Prefab references with other entity are equal ----- ❌ UNEXPECTED

Platform(s)

PC / UEFN

FORT-901744 has been ‘Closed’ as a duplicate of an existing known issue.