I want it to be where if you have W pressed or are moving forwards at the time of jumping you have a force applied onto you to go forwards. This is supposed to preserve momentum. I’m not sure how I would do left and right prob using right and left vectors but rn its not important. My issue is it’s not being deleted when I land! And the next time I jump it’s faster for some reason. I think the former would fix this anyway. Plus idk how to make it so you don’t change direction when you turn maybe using the RelitiveTo setting but idk how that works so please help. The normal stuff is for later don’t worry.
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
local normID = mouse.TargetSurface
local normal = Vector3.FromNormalId(normID)
local char = plr.Character
local hrp = char:WaitForChild("HumanoidRootPart")
local att = hrp.RootAttachment
local UIS = game:GetService("UserInputService")
local hum = char:WaitForChild("Humanoid")
UIS.InputBegan:Connect(function(input, done)
if input.KeyCode == Enum.KeyCode.Space then
local force = Instance.new("VectorForce")
force.Parent = att
force.Attachment0 = att
force.Force = Vector3.new(0,0,-10000)
force.ApplyAtCenterOfMass = true
force.Name = force
force.Enabled = true
local state = hum:GetState()
if state == Enum.HumanoidStateType.Landed then
force:Destroy()
end
end
end)