mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-18 12:11:54 +00:00
Camera zoom keybind and starting camera bobbing animations
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user