I want to move the part into player’s root part. Works when im standing still (check end of the vid) but it just chases me and cant catch me when im walking. How do I fix that?
function easeInBack(t, b, c, d, s)
s = s or .5 -- Overshoot amount
t = t / d
return c * t^2 * ((s + 1) * t - s) + b
end
orb.Touched:Connect(function(hit)
if hit.Name == "PickupHitbox" then
local duration = 1;
local startTime = tick()
repeat
orb.Position = Vector3.new(
easeInBack(tick() - startTime, orb.Position.X, hit.Position.X - orb.Position.X, duration),
math.clamp(easeInBack(tick() - startTime, orb.Position.Y, hit.Position.Y - orb.Position.Y, duration), 0, math.huge),
easeInBack(tick() - startTime, orb.Position.Z, hit.Position.Z - orb.Position.Z, duration)
)
task.wait()
until tick() - startTime >= duration
end
end)