Recently derived a class from
UStaticMeshComponent. In a base actor class, I have this line:
mesh = CreateAbstractDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
And in a derived actor class, say
ActorThing, I try to override
mesh = CreateDefaultSubobject<UStaticMeshComponent, UDerivedMeshComponent>(TEXT("Mesh"));
But I get this error when trying to run the project:
Objects have the same fully qualified name but different paths. New Object: DerivedMeshComponent/Script/Project.Default__ActorThing.Mesh Existing Object: StaticMeshComponent /Script/Project.Default__ActorThing:Mesh
CreateAbstractDefaultSubobject() on a
UShapeComponent before, and it worked fine being overriden. Why does this not work? Is it because
UStaticMeshComponent isn’t an abstract class? I thought it was because I had existing actors of type
ActorThing in the world, but after deleting all off them, this error still persisted. What’s wrong and how do I fix it?
Edit: Changed to an abstract base, still getting that error.