How do you tween the Transparency of a UIStroke

So I have been having trouble tweening the transparency of a UIStroke.
Here is the code that I have been using:

if object:IsA("UIStroke") then
	twnservice:Create(object, tweeninfo, {Transparency = 1})
end

this is part of the script that loops through the descendants of a frame and this sees if it is a UIStroke or not. I can directly change the transparency or thickness of it but I am unable to tween it even though it is an actual property of the UIStroke. If you have any answers please let me know.

2 Likes

This is because you aren’t playing the Tween animation.

Here is your corrected code:

if object:IsA("UIStroke") then
	local selectedTween = twnservice:Create(object, tweeninfo, {Transparency = 1})
	selectedTween:Play()
	selectedTween.Completed:Wait() -- Remove this part if you don't want to wait for this to finish
end
1 Like

I have done this too many times to count thank you for spotting that :sweat_smile:.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.