Created
July 30, 2021 16:51
-
-
Save RobertCodez/82f18858294f51e7fa294396c88f3309 to your computer and use it in GitHub Desktop.
Camera Maniuplation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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