Hello devs, recently i tried replicating a cage roll gambling machine that i’ve found on a game. The problem is the slowing at the end of the rotations.
External MediaI tried my best for an hour or more but didn’t succeed. Here’s my code:
local start = PartToTween.CFrame
local target = PartToTween.CFrame * CFrame.Angles(math.rad(180), 0, 0)
task.spawn(function()
for rotation = 1, 10 do
for t = 0, 1, .035 do
PartToTween.CFrame = start:Lerp(target, t) * CFrame.Angles(math.rad(90), 0, 0)
task.wait()
end
end
local newStart = PartToTween.CFrame
local newTarget = PartToTween.CFrame * CFrame.Angles(math.rad(180),0,0)
local factor = 1
for t = 0, 1, 0.035 do
factor =- .035
PartToTween.CFrame = newStart:Lerp(newTarget, factor)
task.wait()
end
end)
The 2nd for t = 0, 1, .0035 do loop doesn’t slow it properly, it stops instantly and i need help please.
And here’s the result of this code: