So I am in a bit of a dilemma. Basically I need to do a bunch AABB checks but they are inaccurate because my UI hasnt changed its size yet when i set its vertex data. I have to wait for it to be updated by ui grid layout. Problem is I only know how to do wait() and even with game:GetService("RunService").Heartbeat:Wait() it still was super slow. I tried doing this hacky thing where I would basically increment a value and check its modulo and then wait, but it proved to be too unstable for commercial use. So what should I do? How would I yield the thread or maybe predict? Where it’s size and position should be? Isn’t there like some hidden function like UIGridLayout:Wait() that I just dont know of?
Here is a in-game example just to prove my point…
So I am trying to either pause it until its been updated by the uiGridLayout or try and predict its future position and size. That’s my options I can think of. I am trying to pause it for each pixel so it can “load in” in a sense as I know for sure it isnt taking milliseconds to load in.
Maybe you could make a custom object to avoid using uigridlayout completely, to mimic the behavior of it. I had to do something similar for my customizable ui system.
I dont really see any other good option. You might be able to get away with using some kind of recursive function using a conditional check than return true or something once that condition is met.