Camera resets back to default after I set it to CameraType Custom

Camera resets back to default after I set it to CameraType Custom. I want it to keep looking at the front of the truck.

Here’s my current code:

local cameraCFrame = camera.CFrame
ResetCarFunction:InvokeServer() 
camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = cameraCFrame
wait(2)
camera.CameraType = Enum.CameraType.Custom


Thanks!

This code doesn’t work either:

script.Parent.MouseButton1Click:Connect(function()
	local camera = game:GetService("Workspace").CurrentCamera
	local cameraCFrame = camera.CFrame
	ResetCarFunction:InvokeServer() 
	wait(2)
	camera.CFrame = cameraCFrame
	print("done")
end)

Correct me if I’m wrong, but as far as I understand setting the Camera type to Custom locks it to the default (which is looking at the player), however as long as it is Scriptable, you are able to freely choose how it behaves.

So just keep it on Scriptable :smile:

:sob: that sucks…

Is there any way to have a scriptable camera with the default behavior then? Thanks!

I just used cameraSubjects instead

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.