Yes, you can do that. Just duplicate the sphere component and modify it to support more than one sphere. Though, I don’t know if it’s as simple as that since I haven’t seen it. But I’ve made components in C++ before and it’s pretty simple. Edit: Though, I just realized, you’re not going to be able to move them in the viewport since scene components have only one transform. You would have to set their location through the details panel only.
I would just stick with either my or jwatte’s idea; I whipped them both up quickly and they’re easy & straightforward.
I get you want it all contained in one component, but the only types of objects that are going to be using this are pickable ones. Think about it this way: for every new object you create, you’re going to have to add this component to it manually. It would be faster if it came automatically with the object. That’s what a base class is for. Any pickable object inherits from “PickableObject” and comes with the logic for handling the overlap and anything else. For every child actor, all you need to do is add the shapes. Since the shapes will vary per-object, this is a necessary step anyway.
A better example: What if you wanted to animate the shapes? Or attach them to separate components that will be moving? What if you wanted to change the size of the shapes over time. What if a property of the shape is determined by some gameplay element? Put simply: what if the shapes are dynamic. Having them in a single component wouldn’t allow this, but having each shape as a separate component will.