Cframes work in object space?

below I have a script written out, but I have some questions. it works fine and exactly how I wanted to. I got .087 by doing some math with my mom, she understands it but Im fully confused how .087 is able to make it so that it perfectly rotates around the circle. The only reason I could see this working is because when i added the vector it doesn’t use world space and rather the object space? but nowhere in this script did i set it to object space. If someone could just explain why this works so I can add a few more touches to it, that would be great thanks.

edit: I was incorrect it does not actually rotate around the ball, or focus point

local camera = game.Workspace.CurrentCamera

local leftButton = script.Parent.left
local rightButton = script.Parent.right

local LR = 1

print(game.Workspace.ball.Position)

wait(5)
camera.CameraType = Enum.CameraType.Scriptable 

camera.CFrame = (game.Workspace.ball.CFrame + Vector3.new(0,0,5))

leftButton.MouseButton1Click:Connect(function()
	print("clicked")
	camera.CFrame = CFrame.lookAt((camera.CFrame.Position + Vector3.new(-.087,0,0)), game.Workspace.ball.Position)
end)

rightButton.MouseButton1Click:Connect(function()
	print("clicked")
	camera.CFrame = CFrame.lookAt((camera.CFrame.Position + Vector3.new(.087,0,0)), game.Workspace.ball.Position)
end)




So you say that if you spam one button for example leftclick, you just rotate around the circle and not going in a straight direction?

correct
I had originally set it up so it did that, but then I changed it to cframe.lookat and it started going in a circle. the only way for me to explain it to myself is that it uses the object space/local space rather than world space

So cfarme.new is global and cframe.lookat is local?

In the documentation it does say it acomplishes a similar thing

yeah and this is a problem because if I was to change anything with the camera angle like having it look slightly down, it no longer rotates in a circle because it is using the object space. any suggestions to fix this?

I apologize, I was wrong. It does not rotate around the ball and actually goes side to side

Lol, so you got your answer :slight_smile:
Now mark your comment as a solution :wink:

will do. My only question is if I were to make it rotate around the ball, how would I do it. I have decided to simply change the camera type to attach and rotate the ball which is far simpler, but is there an easy way to simply rotate the camera around an object