RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make the player camera lock on a part with smooth rotation"
-- local script local camera = workspace.CurrentCamera local part = workspace.Part -- Change this to the part you want to lock the camera on local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local function update() local distance = (part.Position - character.Head.Position).magnitude local newPosition = part.Position + (camera.CFrame.LookVector * distance) camera.CFrame = camera.CFrame:Lerp(CFrame.new(newPosition, part.Position), 0.1) end while true do update() wait() end