I want to make it smooth, how do I do?
Here’s the code:
local part = script.Parent
local folderbib = game.Workspace.Biblio
local folderhall = game.Workspace.SpawnHallway
part.Touched:Connect(function()
for i,v in pairs(folderbib:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v.Transparency = 0.8
end
end
for i,v in pairs(folderhall:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v.Transparency = 0
end
end
end)
local TweenService = game:GetService("TweenService")
local part = script.Parent
local folderbib = game.Workspace.Biblio
local folderhall = game.Workspace.SpawnHallway
local TI = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
part.Touched:Connect(function()
for i,v in pairs(folderbib:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") then
local A = TweenService:Create(v, TI, {Transparency = 0.8})
A:Play()
A.Completed:Wait()
end
end
for i,v in pairs(folderhall:GetDescendants()) do
if v:IsA("Part") or v:IsA("MeshPart") then
local A = TweenService:Create(v, TI, {Transparency = 0})
A:Play()
A.Completed:Wait()
end
end
end)
like the person above mentioned, using tweenservice could help
local TI = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
The first number controls the time, you can change it to like 0.05, etc