the tick turns off when it disappears from the screen
It sure does, unless it’s a widget component. Perhaps someone else, who can Tick, could query the widget:
But, most importantly:
why is it important to know when the widget goes off screen?
what are you really trying to solve?
what is that last Tick you’re trying to detect for?
Asking, as there may be an elegant solution to the issue you’re having rather than flooding the latent system with delays.
Perhaps there isn’t, but do consider elaborating on the ideal case behaviour you’re after.
I sense OP’s widget is self updating its own screen position on Tick, slides itself off-screen and is unable to return since it stops ticking - gets stuck. It’s a common scenario. I might be wrong, ofc.
This widget is not destructed or removed from parent, it is on the CanvasPanel that is larger than its viewport, and stops ticking when that CanvasPanel goes above or below its viewport.
Because I want to make one action when the widget comes onto screen and the other action when it goes off, and these two actions make no sense without each other.
Will this work when the target widget is NOT the root widget that is being hidden and stopping ticking?
What makes the widget move? How does it come and go?
Roots do not matter. Normally, you’d have a widget manager class that is ticking widgets and makes them move. Widgets are too volatile to update their own location. You can then detect when they exceed screen real estate, or query them with:
It happens when the user clicks some button and the CanvasPanel changes its slot position (SetPosition node) along the viewport.
I do NOT set the Visibility. Even if I try, it will be set only on the root widget in that part of CanvasPanel, but the widget whose ticks I want to track for start and stop - is not the root and there are several tens of its instances.