Hello i wrote a custom character movement from last post made by me, but its kinda bad, and i dont know what else to do to make it perfect. Could anyone help?
local Char = script.Parent
local Hum = Char:WaitForChild("Humanoid")
local UIS = game:GetService("UserInputService")
local Velocity = Instance.new("BodyAngularVelocity",Char.LowerTorso)
Velocity.AngularVelocity = Vector3.new(0,0,0)
local SpinnedOn
UIS.InputBegan:Connect(function(Key, Typing)
if not Typing and Key.KeyCode == Enum.KeyCode.A then
Velocity.AngularVelocity = Vector3.new(0,5,0)
wait(0.5)
Velocity.AngularVelocity = Vector3.new(0,0,0)
SpinnedOn = "A"
elseif not Typing and Key.KeyCode == Enum.KeyCode.D then
Velocity.AngularVelocity = Vector3.new(0,-5,0)
wait(0.5)
Velocity.AngularVelocity = Vector3.new(0,0,0)
SpinnedOn = "D"
elseif not Typing and Key.KeyCode == Enum.KeyCode.S then
Velocity.AngularVelocity = Vector3.new(0,-2,0)
wait(0.5)
Velocity.AngularVelocity = Vector3.new(0,0,0)
SpinnedOn = "S"
elseif not Typing and Key.KeyCode == Enum.KeyCode.W then
if SpinnedOn == "D" or SpinnedOn == "A" then
Velocity.AngularVelocity = Vector3.new(0,5,0)
wait(0.5)
Velocity.AngularVelocity = Vector3.new(0,0,0)
SpinnedOn = "W"
end
end
end)