Change default ActorComponent class inside BP editor

Hi,

I’m not sure how to explain it, technically, but in a brief:

I have a Payload component which I added into my Projectile base class.


UPROPERTY(EditDefaultsOnly, Category = Movement, meta = (AllowPrivateAccess = "true"))
USF_BasePayloadComponent* PayloadComponent;

I wish to have both C++ and BP derived classes from the USF_BasePayloadComponent settable inside my projectile classes, in the blueprints editor, as shown below:

The idea is to have this Dropdown list show up the derived classes from the USF_BasePayloadComponent.

I’m able to do that when I declare a USkeletalMeshComponent with EditDefaultsOnly:


UPROPERTY(EditDefaultsOnly, Category=Mesh)
class USkeletalMeshComponent* Mesh1P;

dba3da49df488b85927173850f37bc19bfd60d3a.jpeg

I can’t have the same results by creating derived classes from my Payload Component as I have with the SkeletalMeshComp. It always shows none, as the image indicates.

Any ideas on how to achieve that dropdown list as desired?

Additional

Here’s how my Payload class is configured:


UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent, DisplayName = "ProjectilePayloadComponent"), Blueprintable, BlueprintType, hideCategories = ("Activation", "Collision", "Sockets", "Variable"))
class PROJECTILES_TESTROOM_API USF_BasePayloadComponent : public UActorComponent
{
	GENERATED_BODY()
        ....


Try adding EditInlineNew specifier to your payload component UCLASS macro (not meta).

Also, be aware that blueprint classes won’t show up in the dropdown until they’ve been loaded, which means you sometimes need to explicitly open the blueprint first.

Thanks for the reply! It really does change in the editor exactly as I desired and illustrated. The problem is that it has no effect when I change the component class (as if it didn’t change), and it seems that everytime I compile it, the details panel hides everything (shows literally nothing), and I have to restart the editor whenever I change it… When I restart, it returns to the default class…

I’m using 4.16.2 engine version.

I’m gonna leave this implementation alone for the moment and stay with what is working now. Later, I’ll come back to this topic and try searching new ways to make it work.

Thanks again, Kantan.