-
What do you want to achieve? I wanna make it so the player’s camera (like third person or first person) changes when a keycode is pressed.
-
What is the issue?
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local key = Enum.KeyCode.Q
local tpdistance = 5
local fpdistance = 0.5
UIS.InputBegan:Connect(function(input, gp)
if gp then return end
if input.KeyCode == key then
player.CameraMinZoomDistance = tpdistance
player.CameraMaxZoomDistance = tpdistance
else
player.CameraMinZoomDistance = fpdistance
player.CameraMaxZoomDistance = fpdistance
end
end)
It works but the problem is it only works when i randomly press something on my keyboard or after a couple of seconds
- What solutions have you tried so far? Nothing. I just figured it out myself, I haven’t searched anything about it yet