ive set up a simple ContextActionService mobile button to change between classic camera and locked in first person camera, for whatever reason no matter what button I try to create when I hold it down or even try to quickly tap it, it just keeps spamming it making it completely useless considering if I want to for example toggle a flashlight I cant do that because it keeps going on and off very fast. here's my code:
local plr = game.Players.LocalPlayer local cAS = game:GetService("ContextActionService") local firstP = false local function handleAction(actionName, inputState, inputObject) firstP = not firstP print("Changed 1st person to "..tostring(firstP)) if firstP then plr.CameraMode = "LockFirstPerson" else plr.CameraMode = "Classic" end end -- Bind action to function cAS:BindAction("ChangeCameraMode", handleAction, true, Enum.KeyCode.Tab)