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
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()
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