VectorForce Mid-Air boost issue

I posted this problem before and my solution was to use LinearVelocity, but in this case I can’t use that so I need another solution. The issue I’m having is that when I jump in the middle of the boost I go super far. However when I use it on the ground I only go forward a little bit (Friction or whatever). Anyways I can have the boost stay consistent in air, on ground, and mid jump? Using VectorForce.

if Char.HumanoidRootPart:FindFirstChild("AppliedBoost") then
		Char.HumanoidRootPart:FindFirstChild("AppliedBoost"):Destroy()
	end
	
	local VF = Instance.new("VectorForce")
	VF.Name = "AppliedBoost"
	VF.Attachment0 = Char.HumanoidRootPart.RootAttachment
	VF.ApplyAtCenterOfMass = true 
	VF.RelativeTo = Enum.ActuatorRelativeTo.World
	VF.Force = Char.HumanoidRootPart.CFrame.LookVector * 25000
	VF.Parent = Char.HumanoidRootPart

	game.Debris:AddItem(VF, TableCheck.DurationAmount)

2 Likes

If you need a consistent distance regardless of whether the player is on ground or mid-air, consider using AlignPosition instead.

Otherwise, I recommend using LinearVelocity instead as it allows you to essentially lock the Y axis by setting the MaxAxesForce with Vector3.new(x, math.huge, z).

It still has issues if you are on the floor, but you can probably get away by checking if the Humanoid.FloorMaterial ~= Enum.Material.Air and shift them up a little before dashing.

1 Like

With AlignPosition will the player still have drop-off? I want the player to still falldown.

Yeah, simply set the AlignPosition’s ForceLimitMode to Enum.ForceLimitMode.PerAxis and MaxAxesForce to Vector3.new(math.huge, 0, math.huge).

This will ensure the AlignPosition calculations will have no impact on the Y axis.

Edit: Do keep in mind that you may need to do some raycasting to prevent dashing through walls.

Alright I’ll try this out and mark it as the solution if it works

Keeps on bringing me to a certain part of the map.

function Boost:ApplyVF(Char : "Character", TableCheck : "Table")
	if Char.HumanoidRootPart:FindFirstChild("AppliedBoost") then
		Char.HumanoidRootPart:FindFirstChild("AppliedBoost"):Destroy()
	end
	
	local AlignPosition = Instance.new("AlignPosition")
	AlignPosition.ApplyAtCenterOfMass = true
	AlignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
	AlignPosition.Attachment0 = Char.HumanoidRootPart.RootAttachment
	AlignPosition.ForceLimitMode = Enum.ForceLimitMode.PerAxis
	AlignPosition.ForceRelativeTo = Enum.ActuatorRelativeTo.Attachment0
	AlignPosition.MaxAxesForce = Vector3.new(math.huge, 0, math.huge)
	AlignPosition.Position = Char.HumanoidRootPart.CFrame.LookVector * 50
	AlignPosition.MaxVelocity = math.huge
	AlignPosition.Responsiveness = 1
	AlignPosition.Parent = Char.HumanoidRootPart
	
	game.Debris:AddItem(AlignPosition, 1)
end

Yeah because you are trying to set the AlignPosition to the LookVector. Change that line to this instead:

AlignPosition.Position = (Char.HumanoidRootPart.CFrame * CFrame.new(0, 0, DISTANCE)).Position
1 Like

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