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