✓ Accepted answer
I have an idea. Create two "ImageLabel" Gui's in the same spot, one being the toggled image and one the non-toggled image. Then create a third Gui, this one a "ImageButton" Gui, and make it the same size and position as the two Image Label Guis. The Image Button should have a higher zindex than the Image Labels. Also, make the Image Button totally transparent. Then change your function so it makes the "ImageTransparency" of the desired toggled state Gui 0, and the other 1, making it appear as if the image has been changed.
local button = script.Parent
local toggled = false
local ToggledImage =
local NonToggledImage =
local function onButtonActivated()
if toggled == false then
ToggledImage.ImageTransparency = 0
NonToggledImage.ImageTransparency = 1
toggled = true
else
NonToggledImage.ImageTransparency = 0
ToggledImage.ImageTransparency = 1
toggled = false
end
end
button.Activated:Connect(onButtonActivated)
4 comments
What is wrong here? this should work
I am asking how to make the child appear once toggled
As long as it's in a local script, the images work, and you have the button correctly identified in your variable, it should work. The only thing I can recommend is using print functions everywhere to try to identify the problem.
ok thanks