Basically, I’m making an OverheadGUI that switches between regiments and there is a delay between the image showing and the text displaying. I want it to both happen at the same time, but idk why it’s not doing so.
Forgot to put the code:
while true do
Clone.GroupName.Text = game:GetService("GroupService"):GetGroupInfoAsync(plr.division1.Value).Name
Clone.Group_Icons.Icon_One.Image = game:GetService("GroupService"):GetGroupInfoAsync(plr.division1.Value).EmblemUrl
wait(switchTime)
Clone.GroupName.Text = game:GetService("GroupService"):GetGroupInfoAsync(plr.division2.Value).Name
Clone.Group_Icons.Icon_One.Image = game:GetService("GroupService"):GetGroupInfoAsync(plr.division2.Value).EmblemUrl
wait(switchTime)
end
You’ll need to preload your assets. That delay is likely from the asset loading in for the first time, and your computer having to download it.
Before your script starts, create a list of all the images you may want to use, then use the Preload function with that list. After this function call is done, it should be much more responsive at switching images.
1 Like
I fixed it by using a coroutine.