View difference between Paste ID: RP7vGGKt and GVct9Xir
SHOW: | | - or go back to the newest paste.
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