Hello, I recently came across a strange behavior of lerp, I understand that the error is 100% on my part, but I still haven’t figured out what the problem is.
Part of the code responsible for moving:
-- Local script
-- Core == Pet
RunService.Heartbeat:Connect(function(dt)
local lerp = 1 - .07 ^ dt
for plr,plrCore in pairs(PlrTableCores) do
local char = plr.Character or plr.CharacterAdded:Wait()
local count = #plrCore
for i,core in ipairs(plrCore) do
local angle = i * (2 * math.pi / count)
local x = math.cos(angle) * ((count - 1) * 3)
local z = math.sin(angle) * ((count - 1) * 3)
local NewCframe = CFrame.new(x, 5, z)
core:PivotTo(core:GetPivot():Lerp(char:GetPivot() * NewCframe, lerp))
end
end
end)
Video: