Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can you transition smoothly between 2 numerical values without increments?

Asked by 4 years ago

so i know you can increase a numerical value using small increments but is there any way to do it fully smoothly

so something like this but instead of the wait at "HERE" then something to smoothly transition between the values

01part = game.Workspace.Part
02touchpad = script.Parent
03 
04cd = false
05 
06touchpad.Touched:Connect(function(p)
07if p.Parent:FindFirstChild("HumanoidRootPart") then
08    if cd == false then
09        cd = true
10        part.Transparency = 1
11        wait(1) -- HERE
12        part.Transparency = 0
13        cd = false
14    end
15end

1 answer

Log in to vote
1
Answered by 4 years ago

Changing properties values over time can be done using TweenService. Links that can help :https://developer.roblox.com/en-us/api-reference/class/TweenService , https://www.youtube.com/watch?v=pKbQbCf9i90

Ad

Answer this question