Images only loading in parent, but not the child

About The Issue

So, essentially, what I mean by Images only loading in parent, but not in the child is that I have an Image Button, with an Image Label in it, in my User Interface.

When it comes to coding it, there’s a very random behaviour happening.
Basically, when assigning the ImageId to the Button (parent), it works, but assigning it to the Label (child), it’s not working, and returning the ImageId as “nil”.


The Code

if item[2].Id ~= nil then
	local imageId = "rbxthumb://type=Asset&id=" .. tostring(item[2].Id) .. "&w=420&h=420"
	templateClone.Image = imageId
end

For example, this would return rbxthumb://type=Asset&id=[Image Id]&w=420&h=420

item[2].Id is returning the id for the image every time, without failure. The above code is when setting it to the Parent, where as the below, is when setting it to the child.

if item[2].Id ~= nil then
	local imageId = "rbxthumb://type=Asset&id=" .. tostring(item[2].Id) .. "&w=420&h=420"
	templateClone.Display.Image = imageId
end

However, this would return rbxthumb://type=Asset&id=nil&w=420&h=420


The Output

When setting the child Image Label to the image

When setting the parent Image Button to the image

NOTE: Setting the image manually works with the frames, using the provided id’s being fetched by the item[2].Id, but using the script, is where the issue arises.


I dont know if this is a scripting issue, or a studio / roblox bug, so I decided to put it here to see if anyone can help / provide assistance.

Thanks :+1:

Is the ImageId nil inside the explorer? Or is it just not showing up?

Its showing the Id as nil in explorer, and not loading the image, but when printing imageId, its showing the Id as working

Could there be any issue with zIndex?

Nope, I tried changing the zindex to all sorts of numbers, even with the addition of changing the ScreenGui to global and sibling, same thing applied :person_shrugging: