Hello devform i am creating a custom character controller, and i have ran into a problem, the character model starts freaking out when i move it to the ground
–video
–script that handles the control
function Controll.Update()
if player.LocalPlayer.Character and player.LocalPlayer.Character.PlayerCapsul:FindFirstChild("bodyVelocity") then
local bodyVelocity = player.LocalPlayer.Character.PlayerCapsul:FindFirstChild("bodyVelocity")
local moveDirection = rightValue - leftValue
if jumping and isOnGround() then
player.LocalPlayer.Character.PlayerCapsul.bodyVelocity.Velocity += Vector3.new(moveDirection, 12, 0)
end
if not isOnGround() then
player.LocalPlayer.Character.PlayerCapsul.bodyVelocity.Velocity -= Vector3.new(moveDirection, 2, 0)
end
player.LocalPlayer.Character.PlayerCapsul.Velocity = Vector3.new(moveDirection, 0, 0) * 20
end
end
how could i possible fix this?