I created a simple mechanic where when you jump or fall off a taller surface you will continue falling at the same speed that you left the surface, instead of instantly stopping in mid-air when you stop walking, which is the default.
How to Use:
- Copy Code and paste in a local script
- Place Local Script in Game > StarterPlayer > StarterPlayerScripts
- Enjoy
Code:
--services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
--constants
local PLAYER = Players.LocalPlayer
local CHARACTER = PLAYER.Character or PLAYER.CharacterAdded:Wait()
local HUMANOID = CHARACTER:WaitForChild("Humanoid")
--variables
local lastVelocity = Vector3.new(0,0,0)
local isOnGround = true
RunService.Stepped:Connect(function()
if HUMANOID.FloorMaterial == Enum.Material.Air then -- in air
if isOnGround then -- just left the ground
lastVelocity = HUMANOID.RootPart.Velocity
end
HUMANOID.RootPart.Velocity = Vector3.new(lastVelocity.X, HUMANOID.RootPart.Velocity.Y, lastVelocity.Z)
isOnGround = false
else
isOnGround = true
end
end)