#can someone help me make a rotating cctv camera

1 messages · Page 1 of 1 (latest)

blissful sage
#

local rotatingHead = script.Parent
local speed = 0.5 -- how fast the camera rotates
local maxAngle = 45 -- max rotation in degrees
local angle = 0
local direction = 1

local baseCFrame = rotatingHead.CFrame

game:GetService("RunService").Heartbeat:Connect(function(dt)
angle += direction * speed
if math.abs(angle) > maxAngle then
direction *= -1
end

-- Rotate around Y axis
local rotation = CFrame.Angles(0, math.rad(angle), 0)
rotatingHead.CFrame = baseCFrame * rotation

end)

#

this is what i have but it dose not rotate the cam just makes it move in place

sleek burrow
#

line 17 you have syntax problem
you need baseCFrame*rotation