Need help with camera manipulation

Hello developers! I don’t know why my script is not working.

It should set the player camera to the part called “Part” This is a local script that is in StarterPlayerScripts.

task.wait(5)

local part = workspace.Part
local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Fixed

while task.wait(0.1) do
	camera.Focus = die.CFrame + Vector3.new(0,10,0)
end

Thanks for any reply!
Bubu.

1 Like

Change that to this

camera.CFrame = die.CFrame * CFrame.new(Vector3.new(0,10,0))

Also are there any errors in the output?

1 Like

The Camera needs to be set to Scriptable to be able to be Manipulated via Scripts.

Change that to:
local part = workspace:WaitForChild(“Part”)

Hope this helps!

Try this:

task.wait(5)

local part = workspace.Part
local camera = workspace.CurrentCamera

local offset = CFrame.new(Vector3.new(0,10,0))

camera.CameraType = Enum.CameraType.Scriptable -- Instead of Fixed

while task.wait(0.1) do
	camera.CFrame = die.CFrame + offset -- CFrame instead of Focus
end
1 Like