i’ve seen in roblox a lot of movement systems that seem to somehow change some functionality to the roblox default movement scripts, especially by making it slide more(which makes it more realistic), in my case, i want the opposite, to stop and go instantly, how would i make it?
i wan’t a movement system similar to this:
do you need to use controllers like vectorforce, linearvelocity, or even assemblylinearvelocity to achieve this?
here’s how it is to me:
it might be unnoticable at first but i’m having extremely trouble moving left and right because of how unresponsive the character is.
how would you make the player velocity so that when they press any key it responds instantly like in the example, and when no keys are pressed, the player velocity stops instantly
i tried this:
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
humanoid.WalkSpeed = 85
elseif input.KeyCode == Enum.KeyCode.S then
humanoid.WalkSpeed = 85
elseif input.KeyCode == Enum.KeyCode.A then
humanoid.WalkSpeed = 85
elseif input.KeyCode == Enum.KeyCode.D then
humanoid.WalkSpeed = 85
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.D then
-- set walkspeed to 0
humanoid.WalkSpeed = 0
end
end)
the code doesn’t work
i believe the movement system i wanna replicate has some kind of system like this
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
--player goes fast in that direction
elseif input.KeyCode == Enum.KeyCode.S then
---player goes fast in that direction
elseif input.KeyCode == Enum.KeyCode.A then
---player goes fast in that direction
elseif input.KeyCode == Enum.KeyCode.D then
---player goes fast in that direction
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.D then
-- player velocity stops
end
end)
help is appreciated!