Skip to content

Instantly share code, notes, and snippets.

@RobertCodez
Created July 30, 2021 16:51
Show Gist options
  • Save RobertCodez/82f18858294f51e7fa294396c88f3309 to your computer and use it in GitHub Desktop.
Save RobertCodez/82f18858294f51e7fa294396c88f3309 to your computer and use it in GitHub Desktop.
Camera Maniuplation
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
repeat wait() until plr.Character
local cam = game.Workspace.CurrentCamera
local zoom = 150
cam.FieldOfView = 10
cam.CameraType = Enum.CameraType.Scriptable
local rs = game:GetService("RunService")
rs.RenderStepped:Connect(function()
local char = plr.Character
if char then
if char:FindFirstChild("Head") then
cam.CoordinateFrame = CFrame.new(Vector3.new(char.HumanoidRootPart.Position.X+zoom,char.HumanoidRootPart.Position.Y+zoom,char.HumanoidRootPart.Position.Z+zoom),char.HumanoidRootPart.Position)
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment