how to set actor widget component position in screen

hi

how would you set the location of a widget component that is part of an actor and that casts to the screen and not the world
i can use set render translation or set render transform
but i think setting the translation will simply change and render at a distance as vector from its location whereas i would rather set the location with no translation away from that location

thanks

sorry forgot about set position in viewport (could not locate it)

1 Like

yes i did set widget >> screen and not world . that part i got going

can i use
convert world location to screen location
and
set position in viewport
or is that bad

No. Just move the widget to the world position, as in the pic above. Don’t confuse the component. There’s no need to do anything else. It’s already projected.

1 Like

how did you manage to use
set world location
which has target of scene component
with a widget
which is a widget

my side it complaiins that the widget is not scene componenet

I am just following what you said… a widget component is a scene component. Drag it from the actor component hierarchy to the graph and set its location.

Manipulate the component, not its 2d widget.

set render transform also works

is it ok or bad

It’s redundant.

1 Like

yes i think i have cast it to full widget in the meantime
so its no longer widget component but widget of blueprint class x

lol
perhaps

if it is a widget and not a widget component
how would you go about
i am working from within the widget blueprint that is the widget component that is in the actor

You are contradicting yourself.

Red - widget component
Green - widget component’s widget

I think I know what you’re trying to do.

  • you have a screenspace widget component
  • you’re trying to manipulate its screen space

i am not (contradicting myself)

i have a widget in a actor
so it is a widget component

i locate the widget component inside the actor at some point because i work in / with its blueprint
when i do that, i cast the widget component (get widget; target = widget component) to a widget and then to the blueprint class the widget is originally from (cast)

so it is both a widget and a widget component

i work inside the widget blueprint so at that point in time it is more a widget tthan a widget component

so how best to set the location transfomr when it is a widget
otherwise i must rather stick to setting it while it is a widget componenet

You’re confusing things. A widget component instantiates a widget and manages its position and lifespan. If you want to manipulate a widget’s screen space, why would you even use a component in the first place? Add it to the viewport, set position in viewport.


If you absolutely muse have a screen space widget comp and manage its screenspace, I’d suggest you re-evaluate what you’re doing. Yes, you can use translation, but why?

widget component as widget must show in screen not in world otherwise it looses view and not always visible (i forgot the fancy word)

widget component must be next to its parent actor

currently it is on top of its parent actor

i need to manipulate the location

and i dont simply want to change is translation

Move the widget component to be next to an actor… as in the original post. This is how health bars are done, for example.

1 Like

think the problem here is that widgets are more complex and less straight forward than they appear to be