local userInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
function turnPlayer(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.A then
player.Character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(90), 0) --Like this, but my code does not exactly rotate my character 90° flat.
elseif input.KeyCode == Enum.KeyCode.D then
--Same thing as the top code, except 90°, its -90°.
end
end
end
userInputService.InputBegan:Connect(turnPlayer)
So every time the A/D key is pressed, I want the character to rotate 90°/-90° degrees flat.
The problem is, every time they rotate, they always rotate to 85.23° (Around there)
Is there a way to accomplish this?
Thank you.
