CameraType.Watch camera is not stationary

I was trying to make the camera track a model without the camera moving.
the documentation suggests that CameraType.Watch does exactly this


but when I used it the camera wasn’t stationary and followed the part
https://streamable.com/1wehtg

I know that I could use render Stepped to do this but that seems wrong when I can supposedly just set the camera type to watch. I was unsure if this was a bug, new feature or if I was just making a mistake so I’ve posted it here

this is the code used in the example:

local camera = workspace.CurrentCamera

camera.CameraSubject = workspace.movePart

camera.CameraType = Enum.CameraType.Watch

camera.CFrame = workspace.Part.CFrame  

thanks

-slitherylemur

2 Likes

well, for now I can’t be sure of nothing
roblox studio is buggy than ever
image
also you can’t chat so that thing about cameratype.Watch can be a bug

function Watch(Camera, Object, StopCallback)
	local Watching = true
	local RSConnection = nil
	coroutine.wrap(function()
		RSConnection = game:GetService("RunService").RenderStepped:Connect(function()
			if not Watching then
				RSConnection:Disconnect()
				return
			end
			if Camera.CameraType ~= Enum.CameraType.Scriptable then
				Camera.CameraType = Enum.CameraType.Scriptable
			end
			Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Object.Position)
		end)
	end)()
	local Stop = Instance.new("BindableEvent")
	Stop.Event:Connect(function()
		Watching = false
		if StopCallback ~= nil then
			StopCallback(Camera, Object)
		end
	end)
	return Stop
end


local Stop = Watch(workspace.CurrentCamera, workspace.Part, function(Camera)
	Camera.CameraType = Enum.CameraType.Custom
	local Character = game.Players.LocalPlayer.Character
	if Character then
		local Humanoid = Character:FindFirstChild("Humanoid")
		if Humanoid then
			Camera.CameraSubject = Humanoid
		end
	end
end)
wait(5)
Stop:Fire()
2 Likes

thanks ill probably be using that, its a nice piece of code. Still annoying though, that cameratype.watch doesn’t do what its says it does. It would be nice to know if Roblox changed this recently or if its a bug or just that I’m not doing/understanding it properly