I’m trying to make long jump mechanics, the issue is I don’t know how I’m supposed to use Look Vector nor do I know how to make it so that its were the players direction is.
Here Is The Code:
UIS.InputBegan:Connect(function(input, gameProccess)
if input.KeyCode == Enum.KeyCode.LeftShift and IsLSDown == true and not gameProccess then
local Vel = Instance.new("BodyVelocity")
Vel.Name = "Velocity"
Vel.Parent = script.Parent.Parent:WaitForChild("Torso")
Vel.P = 20
Vel.Velocity =
end
end)
Also, how does Look Vector work? I couldn’t find anything related on Roblox API Refrence
UIS.InputBegan:Connect(function(input, gameProccess)
if input.KeyCode == Enum.KeyCode.LeftShift and IsLSDown == true and state == "running" and not gameProccess then
local Vel = Instance.new("BodyVelocity")
Vel.Name = "Velocity"
Vel.Parent = script.Parent.Parent:WaitForChild("Torso")
Vel.P = 0
Vel.Velocity = (HumanoidRootPart.CFrame.LookVector * 100) * Humanoid.WalkSpeed
for i = 1, 45 do
wait(0.5)
Vel.P = Vel.P + i
end
wait(3)
for i = 1, 45 do
wait(0.5)
Vel.P = Vel.P - i
end
if Vel.P == 0 then
Vel:Destroy()
end
end
end)