There’s the need to display a
clickable widget on top of the actor,
so it can be clicked to interact with
the actor. For consistency it’s
required that the size of the widget
is always kept the same as its owning
actor, i.e. it’s very important that
they occupy the same amount of space,
one in top of the other.
That’s super clear. Explains why you want to stick to the widget component.
One thing I do not get is a situation where an object is so far away that it occupies just a handful of pixels on the screen. Trying to click the UI element that small would be user unfriendly.
I think that placing the widget on a
screen position that matches its
owning actor’s world location would be
feasible with some of the engine’s
projecting/deprojecting functions.
This part is straighforward, indeed.
It is the very specific requirement of
the widget having the same exact size
as its owning actor what seems more
tricky to do if not using world space
for the widget component or using a 2D
widget.
If the object getting very small is not an issue you can MapRange widget size based on distance between the owning actor and the camera. I was translating distance into widget opacity and Z order to have distant UI elements fade away; it worked well with hundreds on-screen icons at a time.
Do you think that using either 2D
widgets or widget components with
screen space instead of world space is
still feasible for this scenario? If
so, I would find it very helpful if
you wished to give some insight on how
to go that way.
I’m assuming there is no text involved here. Text scaling looks bad most of the time. You’d need to try both methods and see where it takes you. I abandoned widget components (back when they were still called 3d widgets) since they did not suit what I was attempting. Try both.