I want to make a movement system like Evade where you slowly stop moving when you stop moving (Not holding WASD)
I don’t know how, I can’t seem to find out if they use Apply Impulse or if they use something else, even if they do I don’t know how I can implement it so it goes to where I’m WALKING not FACING.
I have tried many sites such as DevForum, no luck. I have no code yet btw I just wanna know how it would be possible so I can use it in a game in the future (when I can work on it)
im not sure what you mean, but what I did was use Quenty’s spring module, then used the :GetMoveVector() on the ControlModule which is under the player’s PlayerModule (default roblox stuff).
then I used BindToRenderStep with a function that would set the target of the spring to what I got from :GetMoveVector() and also used :Move(spring.Position, true) on the player - this makes the players speed “smooth” down and up instead of stop and start immediately
Honestly your gonna hate yourself for not figuring this one out but,
You can simply in a heartbeat loop smoothly ramp up the walkspeed to a MAX_SPEED when their move direction is not equal to 0 (moving), and when it is smoothly ramp down the walkspeed to the BASE_SPEED when their movedirection is equal to 0 (not moving).
I recently did this with one of my projects and it feels AMAZING.
This code does not make any sense, please know that you should be good at scripting to help with scripting related issues. This code represents what you’re trying to say:
local uis = game:GetService("UserInputService")
local movekeys = "WASD"
uis.InputBegan:Connect(function(input, process)
if not process then return end
if input.KeyCode and movekeys:match(input.KeyCode.Name) then
task.wait(5)
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 500
end
end)
A walkspeed of 500 is way to fast, and setting the walkspeed when the character starts walking is redundant, as you can just set the walkspeed before anything happens. @NoraaApple wants to be able to bring the character to a slow stop, instead of an instant stop, when they stop pressing a key to move. So setting the walkspeed is not going to work here.
I think that was a bait comment, its pretty obvious waiting 5 second then putting your walkspeed to some really high number isnt going to get OP the results he wanted
I actually have a simple walk to build speed similar to evade with decreasing speed as you stop walking too. It’s homemade also.
-- SERVERSCRIPT
game:GetService("Players").PlayerAdded:Connect(function(__PLR)
local __FOLDER = Instance.new("Folder")
__FOLDER.Name = __PLR.Name
__FOLDER.Parent = game:GetService("ReplicatedStorage")
local __SPEED = Instance.new("NumberValue")
__SPEED.Name = "__SPRINTSPEED"
__SPEED.Value = 25 -- Change your sprint speed here
__SPEED.Parent = __FOLDER
local __ISSPRINT = Instance.new("BoolValue")
__ISSPRINT.Name = "__SPRINTING"
__ISSPRINT.Parent = game:GetService("ReplicatedStorage")
end)
--LOCALSCRIPT
local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local Humanoid = script.Parent:FindFirstChildOfClass("Humanoid")
local Anim = Humanoid:LoadAnimation(game.ReplicatedStorage.sprint)
local Camera = workspace.CurrentCamera
local debounce = false
local Sprinting = game:GetService("ReplicatedStorage"):FindFirstChild(plr.Name):FindFirstChild("__SPRINTING")
local Sprint
Humanoid.Running:Connect(function(speed)
local SpeedTween = TS:Create(Camera, TweenInfo.new(3), {FieldOfView = 110})
local WalkTween = TS:Create(Camera, TweenInfo.new(2), {FieldOfView = 70})
Sprint = TS:Create(plr.Character.Humanoid, TweenInfo.new(3), {WalkSpeed = game:GetService("ReplicatedStorage"):FindFirstChild(plr.Name):FindFirstChild("__SPRINTSPEED").Value})
if speed > 8 then
if debounce == false then
debounce = true
Sprint:Play()
Sprinting.Value = true
SpeedTween:Play()
Anim:AdjustSpeed(0.8)
Anim:Play()
Sprint.Completed:Connect(function()
Anim:AdjustSpeed(1.3)
end)
end
elseif speed <= 8 and not (Humanoid.WalkSpeed == 0) then
debounce = false
Anim:Stop()
TS:Create(plr.Character.Humanoid, TweenInfo.new(1), {WalkSpeed = 16}):Play()
Sprinting.Value = false
WalkTween:Play()
end
end)
The problem with is, You can’t overrwrite default walkspeed on humanoid, instead you have to change __SPRINTSPEED Value instead.
Though i recommend anchoring humanoidrootpart to “stun” the player if you wanna.
Hey, I am terribly sorry for the late response. School and stuff
If you could, can you send a code example for me and if you can a better explaination.