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

part = game.Workspace.Part
touchpad = script.Parent

cd = false

touchpad.Touched:Connect(function(p)
if p.Parent:FindFirstChild("HumanoidRootPart") then
    if cd == false then
        cd = true
        part.Transparency = 1
        wait(1) -- HERE
        part.Transparency = 0
        cd = false
    end
end

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