Hey guys. I’d like to make a part go transparent within one second. However, the game.Workspace:GetServerTimeNow() function returns a very big number. Is there a way to make it a smaller number?
local function MakePartTransparent(Part)
RunService.Heartbeat:Connect(function(deltaTime)
Part.Transparency += game.Workspace:GetServerTimeNow()
print(Part.Transparency)
end)
end
The goal is to make the part’s transparency 1 in exactly one second. The number is too big when using game.Workspace:GetServerTimeNow() which causes the part to go transparent instantly.
use Tween Service for such things, here’s an example:
local TweenService = game:GetService("TweenService")
local TweenDuration = 1
local function Tween(instance, goal)
TweenService:Create(instance, TweenInfo.new(TweenDuration), goal):Play()
end
Tween(Part, {Transparency = 1})