I’m trying to create a component which I can attach to any arbitrary actor which will act as its “targetable center”. By placing this component on any actor in the world (or actor class) I can mark that actor as an object which can be targeted, by doing an overlap check for actors and then checking for the presence of this TargetComponent, and then use its world transform to create a vector pointing to the exact spot I am targeting. This all seems very straightforward.
This is perfectly viable, but the issue I’m having is that I can’t actually define this child class of a SceneComponent to be anything but, effectively, a blank SceneComponent. I can’t, for example, give it a collision capsule or a billboard sprite or something to make it easy to identify where it exists on an actor. I can’t define some inner or outer bounds for it and easily see those bounds on an actor. etc.
I tried to create a child component based on Sphere Collision, but the engine won’t allow this (at least not without doing extra exposing work in BP). I know I could just create basic Sphere Collision components on actors, and it’s true that those would do what I want, but the issue is I can’t be sure, when I do some check and gather up an array of Sphere Component references, that all of these are valid target components. Any place sphere collision is used would return a valid response, even if it was just, you know, spherical collision, and not a marker for this kind of check.
This shouldn’t be especially difficult in theory, because it’s how a character is fundamentally built; it has some component (its capsule collider) which is not rendered in game but which is accessible and provides some sort of “root” for that object in the world. It should be possible to create other objects of this kind and add them as components to actors, shouldn’t it? What am I missing?