RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create a camera system where the player can move the camera around by just moving their mouse."
Creating a camera system that moves with the mouse movement requires a LocalScript. Here's a script that you can put in StarterPlayerScripts to achieve this: ```lua -- Local Script local player = game.Players.LocalPlayer local mouse = player:GetMouse() local camera = workspace.CurrentCamera local function updateCamera() local mouseX = mouse.Delta.X local mouseY = mouse.Delta.Y local cameraRotation = camera.CFrame local cameraYaw = CFrame.Angles(0, math.rad(mouseX) * 0.1, 0) local cameraPitch = CFrame.Angles(math.rad(mouseY) * 0.1, 0, 0) camera.CFrame = cameraRotation * cameraYaw * cameraPitch end mouse.Move:Connect(updateCamera) ``` This script will move the camera based on the player's mouse movement. Note that this script might not be suitable for all game types, as it will override the default camera behavior. You can adjust the sensitivity by changing the values multiplied by `mouseX` and `mouseY` in the `updateCamera` function.