Camera zoom keybind and starting camera bobbing animations

This commit is contained in:
2023-12-20 17:44:46 -05:00
parent bfca13ed6e
commit b879e5ac85
6 changed files with 141 additions and 76 deletions

View File

@@ -4,12 +4,36 @@ local CameraSettings = require(script:WaitForChild("Camera"))
local Crosshair = require(script:WaitForChild("Crosshair"))
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Storage = game:GetService("ReplicatedStorage")
local Camera = CameraSettings.constructor(Player)
local ClientStorage = Storage:WaitForChild("Client")
local KeyBindsModule = require(ClientStorage:WaitForChild("KeyBinds"))
local Player = Players.LocalPlayer
local CurrentCamera
repeat
task.wait()
CurrentCamera = workspace.CurrentCamera
until CurrentCamera
local Camera = CameraSettings.constructor(CurrentCamera, Player)
local CrosshairObject = Crosshair.constructor(Player)
--Keybinds
local function CameraBinds()
local CameraBindMap = KeyBindsModule.constructor()
CameraBindMap:AddInputBegan(Enum.KeyCode.C, function()
Camera:ZoomIn()
end)
CameraBindMap:AddInputEnded(Enum.KeyCode.C, function()
Camera:ZoomOut()
end)
end
CoreGuis:off()
Mouse:DisablePointer()
Camera:LockFirstPerson()
CrosshairObject:Spawn()
CrosshairObject:Spawn()
CameraBinds()