Actor component not showing on component list

Hello bois

I’ve been trying to create a weapon component deriving from UActorComponent (and a custom interface). here’s the code I’m using in the constructor of the actor owning it:

	DefaultWpn = CreateDefaultSubobject<UDefaultWeaponComponent>("Big gun");
	AddOwnedComponent(DefaultWpn);

DefaultWpn is an instance variable of type UDefaultWeaponComponent*. Here’t the “but”, when I run the game, the component is not visible in the component list of the actor, nor can I use its methods. Am I doing something wrong?

Yours

i think it’s because you’re not doing the “SetupAttachment()” that has to be done after creating a SubObject so its spawning in world 0,0,0

DefaultWpn = CreateDefaultSubobject(“Big gun”);
DefaultWpn->SetupAttachment( // RootComponent, or another component, or a socket, or whatever you want );

Ups, my bad, I just needed to make the ptr edit everywhere. The method problem was elsewhere (my controller wasn’t binded.