Title. I have been trying to create this in a useful way, however each time I tried it is not a good, reliable, and efficient way to make this into a reality. Pretty much what I mean is that I want the camera to rotate in a circle, staying in the same cframe but the rotation moving in a circle-y manner. Current code:
local p = Instance.new("Part",script.Parent)
p.Name = "where"
p.Size = Vector3.new(.1,.1,.1)
p.Anchored = true
p.CanCollide = false
p.Transparency = 1
p.CFrame = script.Parent.Primary.CFrame
while wait() do
for i = 1,360 do
script.Parent.Primary.CFrame = script.Parent.Primary.CFrame * CFrame.Angles(0,0,math.rad(1))
p.CFrame = script.Parent.Primary.CFrame + (script.Parent.Primary.CFrame.lookVector*5)
p.CFrame = p.CFrame + (p.CFrame.rightVector*.5)
script.Parent.CFrame = CFrame.new(script.Parent.Position,p.Position)
wait()
end
end
The code above is extremely inefficient in my opinion, and it can lag in a game since its using a while loop with a wait(), instead of something like a tween or something. Does anybody know about any math equations, math functions, or anything that can help me out in this situation? Also, if you do send me a math equation, can you explain it into detail so I can learn how to use it? Thanks!

2 comments
Line 1. The parent argument to Instance.new is deprecated, assign the in another line.
That's a very small optimization and yes I agree he should replace it but for compatibility reasons but not for optimization