My goal
I want to detect when the camera moves
Problem
I don’t know how to
My code
local Cam = workspace.CurrentCamera
Cam:GetPropertyChangedSignal(Cframe.Position):Connect(function()
print (" Camera moved ")
end)
My goal
I want to detect when the camera moves
Problem
I don’t know how to
My code
local Cam = workspace.CurrentCamera
Cam:GetPropertyChangedSignal(Cframe.Position):Connect(function()
print (" Camera moved ")
end)
When working with the camera you should just use RenderStepped, and to detect if its moved you can use something like
local Camera = workspace.CurrentCamera
local LastCFrame = Camera.CFrame
game:GetService("RunService").RenderStepped:Connect(function()
if (Camera.CFrame ~= LastCFrame) then
print("Camera moved")
end
LastCFrame = Camera.CFrame
end)