Hey, so im making a movement system and I wanted to know how I would make a simple run script have a sorta of momentum like slowly increasing speed when you run. Please help me out.
you can use TweenService if you’re using WalkSpeed
do you think this would work?
repeat
Character.Humanoid.Walkspeed =Character.Humanoid.WalkSpeed + 1
wait(0.1)
until Character.Humanoid.WalkSpeed == 35
oh yeah also here is my entire script
local UIS = game:GetService(‘UserInputService’)
local Player = game.Players.LocalPlayer
local Character = Player.CharacterUIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
local Anim = Instance.new(‘Animation’)
Anim.AnimationId = ‘rbxassetid://11146777848’
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
repeat
Character.Humanoid.Walkspeed =Character.Humanoid.WalkSpeed + 1
wait(0.1)
until Character.Humanoid.WalkSpeed == 35
end
end)UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16
PlayAnim:Stop()
end
end)
also how would i use tweenservice for something like this?
ive only ever knew it for moving positions or sizes.