Looking for advice, whenever I make custom components I always feel like I am approaching it in the wrong way. I always end up wanting to give my components more sub-component functionality.
Simple Concrete example:
I was making an “InteractableComponent” so that anything with this component could potentially be interacted with.
I started inheriting from actor component but it would be nice to have some collision so that it can be detected by traces so I changed base class to USphereComponent. But now I would like to display some in-world text when the player is nearby so I guess I need TextRenderComponent functionality? I can’t have two base classes nor use sub-components so can’t come up with a clean solution. Should the interactable component add the TextRenderComponent to its owner and hold a reference to it?
I come across this problem often e.g. I want a component with collision but also a forward direction or particles so wondering how others structure their code to avoid duplicating code while keeping components “plug and play” i.e. they just work when attached to the actor without the owner needing to implement anything.