Apply two forces at the same time

Background:
I want to constantly move the player forwards in the direction they face, and when they press spacebar they have another force(using AssemblyLinearVelocity) they makes them jump up. The reason I’m not using the roblox built-in jump is being they can jump infinite times as part of the game.
Issue:
Pretty much when I try and do this, I first don’t know how to make the force be applied in the direction the player is facing(which should be an easy fix im just not experienced) and my other problem is when I run my code my jump stutters (video below).

UIS.InputBegan:Connect(function(Input,Typer)
	if Typer then
		return
	end
	if Input.KeyCode == Enum.KeyCode.Space then
		FlapRmt:FireServer()
		
		local jumpVelocity = 100
		humRP.AssemblyLinearVelocity += Vector3.yAxis * jumpVelocity
	end
end)

local connection
connection = rSvc.Heartbeat:Connect(function()
	humRP.AssemblyLinearVelocity = Vector3.xAxis * 10
end)

Instead of setting the velocity to move it to the right, why not change its CFrame?

humRP.CFrame += Vector3.xAxis * .1

You should also be using RunService.Renderstepped, instead of RunService.Heartbeat because RenderStepped runs every frame.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.