RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Can you write a camera script that makes the player's head follow the mouse?"
-- LocalScript placed in StarterPlayerScripts local Player = game:GetService("Players").LocalPlayer local Mouse = Player:GetMouse() local RunService = game:GetService("RunService") local function updateCamera() local character = Player.Character if character then local head = character:FindFirstChild("Head") if head then local mousePos = Mouse.Hit.Position local lookAt = Vector3.new(mousePos.X, head.Position.Y, mousePos.Z) head.CFrame = CFrame.new(head.Position, lookAt) end end end RunService.RenderStepped:Connect(updateCamera)