How do i make a players camera zoom in on the ai that just detected the player

How do i make an ai detection system, when the detects the player it makes the player zoom in on the ai and a sound plays.
I already have the ai, i just dont know how to make it so it zooms on the ai.

If (findplayer) then
– zoom here
end

1 Like

Have you tried Camera.FieldOfView?

-- Local Script

local Camera = workspace.CurrentCamera

for i = 70, 120, 1 do -- Zoom in
    Camera.FieldOfView = i
    task.wait() -- To make the transition smooth
end

for i = 120, 70, -1 do -- Zoom out
    Camera.FieldOfView = i
    task.wait() -- To make the transition smooth
end
1 Like

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