# Camera Rotation When Q is Held

Hey there! I’m trying to basicially rotate the camera in increments, so whenever the q key is held it just steadily adds, for example 1 degree to the camera’s rotation but I’m having trouble doing it I’ll show you how I’ve done it so far

``````userInput.InputBegan:Connect(function(key)
if Typing == true then
return end
if Typing == false then
if key.KeyCode == Enum.KeyCode.Q then
QHeld = true

while QHeld == true do

camera.CoordinateFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(1,0,0)
wait(0.1)
print(QHeld)
end

end
end

end)

userInput.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Q then
QHeld = false

end
end)
``````

This just tells me when the players holding Q,

``````local function onRenderStep()

playerPosition = character:WaitForChild("HumanoidRootPart").Position

cameraPosition = playerPosition + offset

if QHeld == false then
camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition) * CFrame.Angles(math.rad(3),0,0)
else
camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition) * CFrame.Angles(math.rad(3),0,0) * CFrame.fromEulerAnglesXYZ(1,0,0)
end

end
``````

Alright so here’s the issue

``````camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition) * CFrame.Angles(math.rad(3),0,0) * CFrame.fromEulerAnglesXYZ(1,0,0)
``````

This right here is setting the CFrame instantly to 1 degree, what I’m trying to make it do is add 1 degree and then have it keep adding 1 degree until the player lets go of the Q key, The effect is meant to be so that if they hold Q their camera will rotate to the left until they stop holding it, Help would be appreciated!