C++ Components with sub components

Yes, make scene component. One of features of scene components if fact that it can contain other scene components, this action is called attaching.

Make that Port component and that port component code will attach static mesh component to it self to define there apperance.

Alternatively you can extend from UStaticMeshComponent and just set mesh and add game play code to it, it should display mesh normally and execute that extra code. But first option let developer to modify appearance of components more smoothly as they can attach more components to it themselves in bluepritnt editor

there also option to use Child Actor Component which allows to use any actor which contains components defining there appearance as a component in other actor, this also allows to use port out side of the actor.

1 Like