I am using set position in viewport to create a healthbar that is always floating over my character. Everything works like a charm with my blueprint graph, but as soon as i zoom in too close with my camera the widgets are too far out of bounds and they get hidden when they are out of screen.
That would be cool, but as soon as i zoom out i cant do anything to show them again.
Help would be appreciated.
Mhm… I haven’t considered it. Those widgets are being attached to the camera.
If nothing else works i will consider it. Still i am curious why the widget dissappears and does not want to render anymore if its out of bounds. I was thinking to limit the bounds… But its not the best idea either. Is there some function I can call to make it render again? Its not like its getting destroyed - i tried to trigger event on destruct but it didnt trigger.
Yeah it keeps updating, and then once it hits the threshold that the object disappears it stops updating and keep printing same value. There is nothing special about the value tho. Its still within reason
< 500 > -500
It’s not working because the widget that’s not in the screen space does not Tick. Once it’s out and set to Hidden, its own tick cannot show it up again.
That’s why your last method works, the widget never goes out of screen and always Ticks. This is actually useful for screen edge indicators, like incoming damage or direction indicator.
Ideally, you want to do the Tick set position tracking in the actor owning the widget, not in the widget itself - it’s too unreliable. You already create the appropriate widget reference - use it to track the widget. You could probably even skip setting visibility then.
Also, consider adding comments to an answer rather than adding a new answer - it will make it easier for others to keep track.