Adding components to actor based on sockets in mesh
I have a C++ subclass of AActor called AAircraft which in it's constructor does the following:
I then have some blueprints created as a child of AAircraft, for eg BP_Aircraft_Big, BP_Aircraft_Small. Each of these blueprints assigns a static mesh to the AircraftMesh component.
These static meshes have various sockets in them. What I want to do is find all sockets on the StaticMeshComponent where the name contains (for example) "light", and then use CreateDefaultSubObject to create a new component attached to that socket. I want these components to be manipulatable in the components tab when editing the blueprint, and selectable when using the blueprint Viewport - just as with any other component.
Of course, in the C++ constructor, if I call
How do I do what I'm trying to do? I've been fumbling around with the
Thanks for any help.
Hi David Gundry,
The best way to do what you want to do is to create your components that you want to attach in the constructor using
answered Nov 26 '18 at 04:07 PMDarkwindRichard (suspended)
Follow this question
Once you sign in you will be able to subscribe for any updates here