Raycast and vectors help?

  1. **when the player clicks x i want them to launch up and forward at the same time

  2. **it seemingly works the first time, but when you do it any other times instead of updated on the way your humanoid root part is facing it seems like its going in the very first direction again

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

print("halloworld")
plyr = game.Players.LocalPlayer
repeat wait() until plyr.Character
char = plyr.Character
uis = game:GetService("UserInputService")
hrr = char:WaitForChild("HumanoidRootPart")
print("loaded")
deb = false
hum = char:WaitForChild("Humanoid")
uis.InputBegan:connect(function(key,process)
	print("stuff")
	if not process and key.KeyCode == Enum.KeyCode.X and deb == false and workspace:FindFirstChild(plyr.Name.." Stand")then
		print("x")
		deb = true
		local hr = char:WaitForChild("HumanoidRootPart")
		local jump = script:WaitForChild("Jump")
		local loadjump = hum:LoadAnimation(jump)
		loadjump:Play()
		local ray = Ray.new(hr.Position+hr.CFrame*30,hr.CFrame.LookVector*80)
		local hit,pos = workspace:FindPartOnRayWithIgnoreList(ray,{char})
		local bp = Instance.new("BodyVelocity",hr)
		bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		bp.P = 1000
		bp.Velocity = pos
		wait(1)
		bp:Destroy()
		wait(10)
		deb = false
	end
	
	
end)