Hello, I’m having an issue with UIStrokes, whenever I clone one the cloned one does not show up when playtesting, although it does show up in the explorer, I’ve provided a gif to show the issue and the snippet of code that handles the cloning of the UIStroke.
local function AnimateButton(button:ImageButton, originalSize:UDim2, action:string, state:boolean)
local originalOutline = button:FindFirstChildWhichIsA("UIStroke")
if action == "hover" then
button:TweenSize((state and originalSize + UDim2.new(0.03, 0, 0.03, 0)) or originalSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
elseif action == "press" then
if originalOutline then
local newoutline = originalOutline:Clone()
local thicktween = TweenService:Create(newoutline, TweenInfo.new(1), {Thickness = 50})
local transptween = TweenService:Create(newoutline, TweenInfo.new(1), {Transparency = 1})
newoutline.Parent = button
newoutline.Thickness = originalOutline.Thickness
newoutline.Transparency = 0
newoutline.Enabled = true
thicktween:Play()
transptween:Play()
thicktween.Completed:Connect(function()
newoutline:Destroy()
end)
end
button.Size = originalSize - UDim2.new(0.03, 0, 0.03, 0)
button:TweenSize(originalSize, Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.5, true)
end
end