Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UIS = game:GetService("UserInputService")
- local function flickCamera90Degrees()
- local currentCam = workspace.CurrentCamera
- local initialPos = currentCam.CFrame.Position
- local initialRot = currentCam.CFrame - initialPos
- currentCam.CFrame = CFrame.new(initialPos) * CFrame.Angles(0, math.rad(90), 0) * initialRot -- Rotate the camera by 90 degrees around the Y-axis while maintaining the position and orientation
- print("Camera flicked 90 degrees!")
- end
- local function flickCameraBack90Degrees()
- local currentCam = workspace.CurrentCamera
- local initialPos = currentCam.CFrame.Position
- local initialRot = currentCam.CFrame - initialPos
- currentCam.CFrame = CFrame.new(initialPos) * CFrame.Angles(0, math.rad(-90), 0) * initialRot -- Rotate the camera back by -90 degrees around the Y-axis while maintaining the position and orientation
- print("Camera flicked back 90 degrees!")
- end
- local function flickCameraSequence()
- flickCamera90Degrees()
- wait(0.03) -- Adjusted wait time for slightly faster flick speed
- flickCameraBack90Degrees()
- end
- UIS.InputBegan:Connect(function(input, processed)
- if not processed and input.KeyCode == Enum.KeyCode.Q then
- flickCameraSequence()
- end
- end)
Advertisement
Advertisement