Camera focusing on center of part

Hi!
I have een attempting this Camera script, and I want it to spin.

As you can see, it’s focusing on the center of it, rather than outward, because outward would make it detect spinning.

What is the solution here?


Thanks!

Can you show your code?


local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera

local PlayButton = script.Parent.PlayButton

repeat wait()
	Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame

PlayButton.MouseButton1Click:Connect(function()
	Camera.CameraType = Enum.CameraType.Custom
	PlayButton:Destroy()
end)

Sorry, I forgot to include it.

You need to keep updating the camera’s CFrame

local Connection = game:GetService'RunService'.RenderStepped:Connect(function()
	Camera.CFrame = workspace.CameraPart.CFrame
end)

PlayButton.MouseButton1Click:Connect(function()
	Connection:Disconnect()
	Camera.CameraType = Enum.CameraType.Custom
	PlayButton:Destroy()
end)
1 Like