Actor component not showing on component list
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 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?
asked Nov 26 '18 at 03:18 PM in C++ Programming
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 );
answered Nov 26 '18 at 08:44 PM
Ups, my bad, I just needed to make the ptr edit everywhere. The method problem was elsewhere (my controller wasn't binded.
answered Nov 26 '18 at 09:20 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here