So I’m trying to make a custom movement system for my game and I’m using body velocity (for reasons that make the game what it is)
It’s working fine but you can’t stop when you start to go. I tried searching this up a bit ago but came to no avail.
Any help?
-- getting the player and stuff
local player = game:GetService(“Players”).LocalPlayer
local char = workspace:FindFirstChild(player.Name)
local bodyvelocity = char:WaitForChild(“Body”).BodyVelocity
local camera = workspace.CurrentCamerarepeat wait() camera.CameraType = Enum.CameraType.Scriptable until camera.CameraType == Enum.CameraType.Scriptable -- settings up the system local tweenservice = game:GetService("TweenService") local UIS = game:GetService("UserInputService") -- Actual System Script UIS.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.W then tweenservice:Create(bodyvelocity, TweenInfo.new(.5), {Velocity = Vector3.new(5,0,0)}):Play() elseif not input.KeyCode == Enum.KeyCode.W then tweenservice:Create(bodyvelocity, TweenInfo.new(.5), {Velocity = Vector3.new(0,0,0)}):Play() -- Doesnt work for some reason? end end end) while wait() do camera.CFrame = char:WaitForChild("CamPart").CFrame end