So I wish to change a beam’s transparency using Tween/TweenService, however I keep getting the following error:
TweenService:Create property named ‘Transparency’ cannot be tweened due to type mismatch (property is a ‘NumberSequence’, but given type is ‘double’)
Which I can only assume is because the goal target is a double, which from what I can tell should be a single value/number.
local blo = script.Parent.Blade.Start:WaitForChild("Beam")
local start = script.Parent.Blade.Start
local eend = script.Parent.EndPart:WaitForChild("End")
local TweenService = game:GetService("TweenService")
local blostarti = TweenInfo.new(0.1)
local blostopi = TweenInfo.new(1)
local goal1 = {}
goal1.Transparency = 0
local goal2 = {}
goal2.Transparency = 1
local blostart = TweenService:Create(blo, blostarti, goal1)
local blostop = TweenService:Create(blo, blostopi, goal2)
--Everything below this line is pretty much working as intended, as I found out in testing the code with brightness instead of transparency
while true do
wait(5)
if blo.Transparency == 0 then
blostop:Play()
else
blostart:Play()
end
end
Here is the explorer view, should it prove to be any help:
Do note that I have tried replacing Transparency with Brightness and it worked as intended.
I have put the beam’s initial Transparency as a single number (0), but it’s still the same message.
I have tried searching scouring the internet for this problem but apparently my Googling skills aren’t on-par with this issue.