Hello!
Here’s what I’m trying to achieve - I would like to be able to dynamically create a member component by selecting from the drop down menu one of its possible implementations. In another words, I would like to store a pointer to some abstract base class and be able to create the actual object from editor by selecting another class that inherits from that base class. I’ve done the following:
-
defined base abstract class
UCLASS(Abstract, EditInlineNew)
class UBaseComponent : public USceneComponent
{
GENERATED_BODY()
} -
defined class that inherits from the base class:
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class UDefaultImplComponent : public UBaseComponent
{
GENERATED_BODY()
} -
defined a pointer to that base class in another component, lets call the component UMyComponent
UPROPERTY(EditAnywhere)
UBaseComponent * _CustomComponent = nullptr;
Now, if I create an an empty actor and add UMyComponent to it, everything works as expected - there is in fact a drop down list, from where I can select UDefaultImplComponent and further modify it properties. If I however create an actor, add UMyComponent to it, and then create a blueprint from that actor, the same steps as above works only inside blueprint editor, meaning I can only modify the base blueprint itself, but not the instances of that blueprint.
Is this a bug in UE4 or am I misusing something or perhaps what I wan’t can’t be achieved in that way/at all? Thank you!