Array of instanced editinline objects within a component are not duplicated within placed actors with a component instance

Say I have UMySpecificComponent with a member array MyArrayOfMySpecificUObjects. If UMySpecificComponent is added to an actor, placed in a level with multiple sub levels and a user attempts to save than the save will fail. The error is Graph is linked to private object(s) in an external package because the UMySpecificUObject entries in the instance of the actor are the same entries in the template/default object. The UMySpecificUObject entries are not new/duplicated.

Also see https://forums.unrealengine.com/showthread.php?1243-Can-t-save-map-blueprint-with-class-using-EditInlineNew

class UMySpecificComponent : public UActorComponent
{
UPROPERTY(EditAnywhere, Instanced, Category = "MyCategory")
TArray<class UMySpecificUObject*> MyArrayOfMySpecificUObjects;
...
}

UCLASS(BlueprintType, EditInlineNew, DefaultToInstanced)
class UMySpecificUObject: public UObject

Hi ! You don’t happen to have a uproject that demonstrates the issue do you?

No I don’t. My project is too custom to strip out something like this. I can try to make one when I get some free time.

You might want to give it a shot in 4.7.3, which should be coming out soon. We’ve fixed many of these types of errors in that fix, so it’s worth checking out.

Hi ,

Is this error still occurring in 4.7.3 or 4.7.4?

I apologize. I still haven’t tested it with one of those builds. My team doesn’t use release builds. I’ll get around to it one of these days.

Hi ,

Not a problem at all! I will mark this thread as answered for tracking purposes. However if/when you update if you are still experiencing the error please comment here so we can continue to assist you.

I know this is old, but I am having the same issue with the current release of 4.13. In fact, any EditInlineNew, DefaultToInstance, or Instanced keywords do not allow instantiation of UObjects in an Array of a UActorComponent. I have about 8 Child classes of the type that is declared.

111547-arrayinstance.png

Hi SmartyMARTY,

Do you have a sample project or steps I can take to reproduce this on my end?

I have same problem in 4.13.2. Unfortunately I can’t provide the project either.
Also the following “ensure” macro is trigged when opening the actor that contains the ActorComponent in the editor.

const UObjectProperty* TargetPropety = Cast<UObjectProperty>(CurrentProp);
		if ( ensure(TargetPropety && TargetPropety->HasAnyPropertyFlags(CPF_InstancedReference)) )
		{ 
			return TargetPropety->GetObjectPropertyValue(ValuePtr);
		}

in file …\Engine\Source\Runtime\Engine\Public\InstancedReferenceSubobjectHelper.h : ln 96

Our code looks something like this:

UCLASS()
class UProductionComponent : public UActorComponent
{
	GENERATED_BODY()
public:
	// ...
protected:

	UPROPERTY(EditDefaultsOnly, Instanced, BlueprintReadOnly, Category = RTSCategory)
	TArray<class UProductionEntity*> productionEntities;

//...

UCLASS(editinlinenew, Blueprintable, BlueprintType)
class UProductionEntity : public UObject //...

Hey SmartyMarty and -

Can you explain or provide a short video of the outcome with the code that you’ve tested? I’ve tried setting up a project based on the information and code provided. Let me know if this setup is similar to what you’re seeing:

  • Create new class as a child of UObject (named MyObject) with UCLASS(BlueprintType, EditInlineNew, DefaultToInstanced)
  • Create new class as a child of UActorComponent (named MyActorComponent) with array of UMyObject
    ( UPROPERTY(EditAnywhere, Instanced, Category = "MyCategory") TArray ArrayOfMyObjects;)
  • Create a new class as a child of MyObject (named SecondObject)
  • Compile code and make new blueprint based on Actor (named ActorBP)
  • Add instance of My Actor Component to the blueprint
  • Select My Actor Coponent and add element to array of MyObjects

When I click on the dropdown for the array element, I see both MyObject and SecondObject listed and can be set (See Screenshot). When I place an instance of ActorBP in the level, I can see the values set in the blueprint but these values cannot be changed on the instance. If this is the behavior you are referring to, please let me know. This does not seem like the intended behavior and has been reported here: Unreal Engine Issues and Bug Tracker (UE-38871) . In this case I was able to save the level/project without returning any errors as described in the original post. If you are getting an error when saving, please also explain how your level/project is setup as well. If the behavior you’re seeing is different than what has been described, please try to explain what the visual outcome is that you’re seeing so that I can be on the look out for the same behavior on my end.

Thanks

115741-arrayofmyobjects.png

Hey SmartyMarty and -

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

It is pretty old question… but,

When you got the error ‘Graph is linked to private object(s) in an external package’, I recommend you to ‘Try refresh all nodes’. It resolves the problems in many cases.

https://docs.unrealengine.com/latest/images/Engine/Blueprints/UserGuide/Events/Custom/refresh_all_nodes.jpg

@- I am still having the same issue in 4.15 and I created a new question for it here, I would appreciate any help I can get!

Still the same problem in 4.21 unfortunately…
It is a shame as it is a very useful workflow tool that’s used throughout the engine.