I am working on creating Actor Components to do tasks for my games Actors/Pawns.
I have a custom HolderInt:UObject (currently it has some ints, and a custom Enum) that is being held by an ActorComp:UActorComponent
I made a blueprint BP_ActorComp:ActorComp.
then made a blueprint BP_CombatPawn:Pawn (adding just a plane, boxCollider, and a BP_ActorComp)
If I edit a specific instance of the BP_ActorComp held by BP_CombatPawn (drug out of the ContentDrawer into the level) it works.
if I try to modify the BP_ActorComp held by the reference (in the ContentDrawer) BP_CombatPawn I get an error when trying to save the blueprint:
Can’t save [project path]/Content/Blueprints/BP_CombatPawn.uasset: Graph is linked to external private object HolderInt /Game/Blueprints/BP_ActorComp.Default__BP_ActorComp_C:HolderInt _0 (Referenced because it is an archetype object)
If I edit the reference BP_ActorComp directly it throws the same error on the reference BP_CombatPawn (I am guessing because it is propagating the change to all things that reference it, marking them as needing to be saved), but exiting the editor and relaunching clears the “save needed flag” on BP_CombatPawn
ActorComp and HolderInt are marked DefaultToInstanced, and the TObjectPtr(HolderInt) is also marked Instanced and EditAnywhere.
none of these classes have their headers in the private directory, so I don’t know what it means by “external private object” and searching for “Unreal Engine Archetype Object” the most helpful results talk about “Archetype Objects as reference templates for instances” but that doesn’t mean what it is private, or why I am not allowed to edit the instance of HolderInt held by the BP_ActorComp through BP_CombatPawn, but I am allowed to edit HolderInt through BP_ActorComp.
can anyone give help for understanding what is going on here?
To Staff: this error message is not meaningful or helpful as it includes very little information on what the specific terms mean, and why it is being triggered.
since originally posting this I have pieced together:
EditDefaultsOnly:
means that this is an archetype object
the engine will only ever allow the property to be edited in blueprints
EditInstanceOnly:
this field can only ever be edited in an instance (pulled directly out of the Content drawer into the level, or at runtime), and never in a blueprint
classes marked DefaultToInstanced, or an Object Pointer marked Instanced
if these are marked as EditAnywhere they should basically be treated the same as marking the UPROPERTY(EditInstanceOnly) even though they can be combined with other access specifier even whe they can contradict and cause errors/crashes
This is a compound issue of UHT and UBT allowing for DefaultToInstance objects can be marked with EditAnywhere, or UPROPERTY(Instanced, EditAnywhere) and then the error message being cryptic.
the best work around for this issue: put in the comment for any UPROPERTY(EditAnywhere) or UPROPERTY(Instanced, EditAnywhere) for a pointer to a class marked DefaultToInstanced like “Only edit this in the Level don’t edit this in Blueprints or saving will CRASH”
in my mind the best way to prevent this error is: for when the Header and Build Tools see a class marked DefaultToInstance either do not allow for EditAnywhere (similar to the limitations already in place for Visibility/Access specifiers I can’t put UPROPERTY(EditDefaultsOnly, VisibleAnywhere) even though the meaning could be understood as Editable in blueprints, but Visible Everywhere else) to be placed on it
maybe a UPROPERTY() pointer to a class Marked DefaultToInstanced or the UPROPERTY(Instanced) could default to EditInstanceOnly. if the Engineer/programmer marks it VisibleAnywhere it maintains the EditInstanceOnly but then allows the fields to be visible in Blueprints)
If this is not a feasible change then maybe add to the Error Message
“Classes marked DefaultToInstanced or UPROPERTYs containing Instanced should not be modified in Blueprints and only modified in the Level Details Window, or at runtime”