I’m attempting to make a running script that only deactivates when the player stops moving/running. When the player presses the button they’ll start moving and running; I want the player to stop running automatically when they stop moving. I’ve tried using the humanoids move direction but it only returns 0,0,0 which doesn’t help.
Why not just have the player click the button again to stop running?
Well If I did that a player could stand still and do other stuff while the run animation is still playing making it appear weird
Code below:
RunBtn.TouchTap:Connect(function(touchPositions: {any})
if IsTapped then return end
IsTapped = true
RunStart(true)
RunConnection = RunService.RenderStepped:Connect(function(deltaTime: number)
if Humanoid.MoveDirection == Vector3.new(0,0,0) then
RunEnd()
RunConnection:Disconnect()
IsTapped = false
end
end)
end)