Upscalefanatic3

(Place Inside PlayerStarterScripts) Camera Movement script

Jan 4th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game.Players.LocalPlayer.CharacterAdded:Wait()
  2. wait(1)
  3.  
  4. local Mouse = game.Players.LocalPlayer:GetMouse()
  5. local Camera = game.Workspace.CurrentCamera
  6. local defCFrame = Camera.CFrame --Default CFrame without mouse value
  7.  
  8. local function Update()
  9.     local mx = Mouse.X / 1000 --Reduce value for faster movement
  10.     local my = Mouse.Y / 1000 --Reduce value for faster movement
  11.     Camera.CFrame = defCFrame + Vector3.new(mx, -my, 0)
  12.     defCFrame = Camera.CFrame - Vector3.new(mx, -my, 0)
  13. end
  14. game:GetService("RunService").RenderStepped:Connect(Update) --Update Camera.CFrame every frame
Add Comment
Please, Sign In to add comment