Images not loading for a UI Occasionally

I have a UI for a Gun that I use to display ammo and other info (such as the player’s sprinting/crouching state) and occasionally when the player respawns and equips their guns, the image does not load correctly for the background, causing this:

image

This is the intended behaviour:

image

As you can see sometimes the images don’t load correctly, which then causes a spam of infinite yields in the console. The issue gets fixed when the player respawns/resets.

1 Like

How are you currently displaying the image - is it just a straight image object (Label or Button) in your Gui? What other solutions have you tried, such as preloading the image? What’s being printed to the console as mentioned in the OP? Does this happen in Studio Play Solo without APS, or with it, or on an live server, or a combination of these? Some of these crucial details have been left out from the OP and that makes it harder to determine what the issue is, or whether it’s something you’re able to fix at all (i.e. a bug with the engine or Studio itself).

1 Like

ImageLabel inside a ScreenGUI. Tried Preloading the image too, however it only happens sometimes when the player respawns so I don’t see why PreloadAsync would help. It’s happening on a live server. The error is an infinite yield on WaitForChild('BackgroundImageHere')

@colbert2677 You seemed to want this information to continue further, do you now have any idea what is causing this? This issue still stands if anyone would like to contribute a possible solution.

I oddly didn’t get a notification that you replied to my comment until you pinged me. Happy birthday. by the way.

Are you able to post a code snippet from where the WaitForChild is located, as well as the script’s location? If your issue is an infinite WFC initially but not upon respawn, it might be an issue with that script itself. Otherwise, placing an image raw to a ScreenGui should not yield an error unless it was declined (which, by the content of this post, it seems it wasn’t).

Does it also happen in Studio? Check for both APS and without APS.