Hi,
no matter how I create objects inside an actor, they are never saved when I reload the project
-
created in the class constructor, then disabling the in-constructor creation, sub-objects are not there on preoject reload
-
if I create them outside of the constructor, they don’t even appear in the actor editor scenegraph
no matter what, they are not saved and are gone when reloading the project
here is a full loading code for static mesh that I use
UStaticMesh* Mesh = FetchStaticMeshObject(Name, path, Pos, Rot, Sca);
UStaticMeshComponent* StaticMeshComponent;
if (calledFromConstructor)
{
StaticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(FName(name + "StaticMesh"));
}
else
{
StaticMeshComponent = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), FName(name + "StaticMesh"));
StaticMeshComponent->RegisterComponent();
}
StaticMeshComponent->SetStaticMesh(Mesh);
StaticMeshComponent->SetRelativeLocation(location);
StaticMeshComponent->SetRelativeRotation(rotation);
StaticMeshComponent->SetWorldScale3D(scale);
StaticMeshComponent->SetupAttachment(RootComponent);
what am I missing ?
thanks for your help