Summary
In the past Scene Graph prefabs permitted partially initialized components. Nowadays it’s no longer allowed. Unless there’s a further plan to permit this in the far future where the reflection would expose the bits that require explicit code side initialization I think there’s a possible solution which can be applied in the near term.
Currently the issue will be the reflected entity type, which must be concrete
as the base entity
type is marked as such. The entity itself is still concrete, it’s only that some components are partially initialized and during internal construction, this would be illegal. However, such entities are not meant to be initialized from code, or at least not at this point of time. Such entities with partially initialized components can be considered “editor-only” initializable (read below).
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Other
Steps to Reproduce
Create a component with an editable property that has no default value.
my_component := class<final_super>(component) {
@editable
TargetEntity: entity
}
Create a prefab (my_entity
) and add that component to it, without setting the value. The editor will error out as this workflow has been disallowed.
Expected Result
The editor should not reject this component workflow.
In order to solve the issue that someone could initialize such a reflected prefab from code, the reflection will straight prohibit this via the
<epic_internal>
access modifier on the constructor’s side.
- my_entity<scoped { ... }> := class<final>(entity):
+ my_entity<scoped { ... }> := class<final><epic_internal>(entity):
^~~~~~~~~~~~~~~
This way the type can still be used in code when fetching or working with the prefab, but only the editor will be able to fully satisfy the initialization of that entity.
Furthermore make sure that concrete_subtype(entity)
is not circumventing the construction and honors the <epic_internal>
flag on the constructor.
Observed Result
The editor is stricter and rejects partially initialized components in prefabs.
Platform(s)
PC (v37.00)