[Bug]UUserWidget NativeTick isn't called when widget was added to viewport and moved outside

Hello! As it was described in forum thread link text UUserWidget NativeTick function (and it’s blueprinted version) isn’t called in case widget was moved outside of viewport area. As I noted in this thread, the reason is that this function is called in coresponding Slate widget function Paint, which in order is called from SConstraintCanvas::OnPaint. If we moved widget over SetPositionInViewport and it’s rect became outside of the SConstraintCanvas rect, this function will not be called. It’s seems like an optimisation beyond 4.8 and 4.9, but that brokes some things.
For example, I have UMG widget, which correspons for the actors on scene and draws over them. In this tick function I project actor’s position to screen space and set widget position to that coordinates with aligment in center of widget.
It seems to be workaround. We can prevent this movement by calculations of future position and testing its intersection with viewport. If widget seems to be out we just hide it, but still receive tick, and when it will became again on screen, we show it. But this makes things harder, especially for those who tries to do that in blueprints. Or we can do this placement in some other place who owns this widget.
Anyway I think such behaviour must be described anywhere and may be it will be good to do a way for avoding this simply.in future releases.

I found related post with other workaround link (set a timer function).

Hello polterageist,

This is a known functionality of the engine. I have gotten confirmation from the developers that this is working as intended. I have also provided a link to the original issue.

Link: https://answers.unrealengine.com/questions/319979/inventoryuiwithumg-project-issues.html#comment-320689-form

Make it a great day

Thank you for reply, it is realy seems to be intended. But it is realy is a problem. I’m trying to detect position, when the widget will be out of screen to prevent it. But it is a bit hard and I still have no working code for that. The problem is still here when I reworked my code to place widget on a canvas. May be, it will better to prevent such situation on engine side? I mean when setting vidget position. Anyway it will be better I think to describe that behaviour in documentation, because it is not obvious.

The problem with canvas is that I can not find a way to determine canvas size in generic form.