local run = game:GetService("RunService").RenderStepped local keyheldq = false local keyhelde = false function onKeyPressQ(inputObject, gameProcessed) if inputObject.KeyCode == Enum.KeyCode.Q then keyheldq = true while keyheldq do torsorot = 0 local rot = 0 while torsorot < 100 do torso.CFrame = CFrame.new(torso.Position) * CFrame.Angles(0, rot, 0) rot = rot + .01 print(rot) run:wait() end wait() end end end function onKeyReleaseQ(inputObject, gameProcessed) if inputObject.KeyCode == Enum.KeyCode.Q then print("Stopped holding the Q!") torsorot = 100 torso.CFrame = CFrame.new(torso.Position) keyheldq = false end end game:GetService("UserInputService").InputBegan:connect(onKeyPressQ) game:GetService("UserInputService").InputEnded:connect(onKeyReleaseQ)
When the key Q is released, it doesn't stay at the Angle, it resets the angle to 0 again, and it doesn't stay,
I'm trying to make a character customization menu.
This is for character rotation as you might noticed.
Line 36
torso.CFrame = CFrame.new(torso.Position)
. You just reset the angle. Unless the thing is going to move, don't even bother setting the Position with it.
On a side note, if you're planning on making it rotate the other direction, you might want to take rot
out of that loop so that you can keep it between events.