How would I make an egg decrease in it's distance from the camera?

So I have this script:

            local conc
            conc = RunService.RenderStepped:Connect(function()
                Egg:PivotTo(Camera.CFrame * CFrame.new(0,0,(-Egg.PrimaryPart.Size.Z * 2))*CFrame.Angles(0,0,math.sin((tick() - StartTime)*10)/1.5))
            end)

I was just wondering if there is a way for me to change the 2 using a function like sine, I did think of just using a for loop and updating a variable, but I don’t know if that’s the best way

1 Like