Custom UObject property in AACtor prevent level saving

Hi Community,

I am in front of a problem that i am unable to resolve since some times now.

Unreal 4.7.2
I have a custom complex AActor class that i can add to a level and save.

But when i add an instance of a UObject in it, for example like this:

UPROPERTY(VisibleAnywhere, Instanced,  Category = Terrain)
UTerrainGenerator* TerrainGenerator;

that i can use inside and configure from editor, I am unable to save my level anymore:

Can’t save …test.umap: Graph is
linked to private object(s) in an
external package. External Object(s):
TerrainGenerator Try to find the
chain of references to that object
(may take some time)?

TerrainGenerator UObject is actually just a collection of int32 Properties now and has no reference in it.

I cannot figure why and find a solution for this.

Thanks for your help.

Daes

For information my TerrainGenerator Class is : (nothing special)

UCLASS()
class TEST_API UTerrainGenerator : public UObject
{
GENERATED_BODY()

public:

UTerrainGenerator();

UPROPERTY(EditAnywhere, Category = Terrain)
float IslandPercent;

UPROPERTY(EditAnywhere, Category = Terrain)
float CenterIslandPercent;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 VerticalPercent;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 HorizontalPercent;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 ExpandFactor;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 ContractFactor;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 MinColumnSize;

UPROPERTY(EditAnywhere, Category = Terrain)
int32 MaxColumnSize;

};

If you are only holding data your should a USTRUCT. If you have actual complicated logic and you require an UObject what you can do is to set the UPROPERTY of it to transient, this way it wont get saved.

Another important part would be to see how and where do you create your current object.

Thanks for answer, Moss.

The TerrainGenerator is mainly a list of parameters that i want to be “editor usable”.
I want it to have some functions to generate another structure, but i remove everything to be sure of the failing reason.
I am affraid that putting it to transient will loose the parameters it contains when saving the level.

Like i said in the first message, this object is a property of a complex UObject declared like this:

UPROPERTY(VisibleAnywhere, Instanced,  Category = Terrain)
UTerrainGenerator* TerrainGenerator;

I constructed it like this in the Object Constructor and do the same in the OnConstruction function, for it to be able to take into account the change of TerrainGeneratorTemplate class parameter (which is another property of the main Object).

TerrainGenerator = ConstructObject<UTerrainGenerator>(TerrainGeneratorTemplate, this, FName("TerrainGenerator"));

But does your answer mean, it is the normal behaviour that the level refuse to save only because i have a very simple UObject referenced in one of my actor?

I tried Transient as you said, and strangely the TerrainGenerator inner parameters are saved with the level so it is perfect for me.
So I just don’t understand the Transient keyword and the fact that it failed to save the UObject.
I thought UObject derivation enforce the serialisation ability, and so it seems easy to save them, but…

However thanks for putting me in the rail about Transient, it resolves my problems for now.

How can i tell the message to be resolved in the hub ?

There is a check-mark on the upper left of the answer itself, just clock it and it will get accepted. Nice I could help!

done. Thanks again.