How to lerp 360 on 2d

so i tried to make a ui rotate 360 slowly and it did not work using lerp script:

local hover = true
local plr = game:GetService("Players").LocalPlayer
local main = plr.PlayerGui:WaitForChild("ScreenGui")

function Lerp(a, b, t)
	return a + (b - a) * t
end

print("a")

local function render(v)
	local s,e = pcall(function()
		if hover == true then
			v.Rotation = Lerp(v.Rotation, math.cos(tick() * 20) * 20, 0.5)
		else
			v.Rotation = Lerp(v.Rotation, 0, 0.2)
		end
	end)
end

game["Run Service"].RenderStepped:Connect(function()
	render(main.Main.SideUis.ASettings.cd)
end)
1 Like

I think you’re overcomplicating things, just use TweenService

1 Like

Yeah, Tratium is correct, this isn’t what lerping was made for. Just tween it.

1 Like

ok lemme try it (hiiiihmhmhmmhmhmh)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.