Composition for SceneComponents

Hi everyone,

I have understanding Composition principle for ActorComponents - it is pretty simple, divide logic by singe responsibility and use it in Actors where it is needed. This way we achieve modularity, cleaner approach and so on.

But what about Scene Components? Let’s say I have BP_Window, and it has two meshes, one is frame other is window which can be opened. I would like to implement InteractableComponent which will be attached to second mesh only.

What should be parent in this case, InteractableComponent or StaticMeshComponent? How to solve relationship in this case, since InteractableComponent should have hard reference on StaticMeshComponent? Also, it could be double-window, so two meshes. I assume this InteractableComponent will be attached to both window meshes and use GetParent or something like that, and will keep reference to parent SceneComponent, is it good enough?

What are your solutions? I really wish to have as much modular game as possible, since it could be re-used later on :slight_smile:

Thank you in advance!