this script suppose to make the player rotate to the front or the back when they press W or S, rotatting to the front seems to be working all right but when i tried to make them rotate to the back it just stop at like 135 degrees angle, like this:
External Media^ i swear is a video and not a virus
Script:
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
local humanoidrootpart = character:FindFirstChild("HumanoidRootPart")
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.W then
local goal = {}
goal.CFrame = CFrame.new(humanoidrootpart.Position) * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Back)
local tween = TweenService:Create(humanoidrootpart, tweenInfo, goal)
tween:Play()
end
if input.KeyCode == Enum.KeyCode.S then
local goal = {}
goal.CFrame = CFrame.new(humanoidrootpart.Position) * CFrame.Angles(0, -180, 0)
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Back)
local tween = TweenService:Create(humanoidrootpart, tweenInfo, goal)
tween:Play()
end
end)