Jetpack Glitching Midflight

Hello there, I am trying to make a jetpack to add to my game but it will keep glitching during flight. I have used the AssemblyLinearVelocity many times to launch players but this time it is not working.

I have tried looking on YouTube and The Developer Hub for ways to solve this but haven’t found anything.

Here is a download of the Jetpack:
JetpackSample.rbxm (16.7 KB)

Here is the script I am using inside the jetpack:

while true do
	if flying == true and fuel > 0  then
		
		---- Use Fuel
		fuel = fuel - 1
		
		---- Set the Gui To See Fuel Level
		setSize = fuel / 1000
		setPos = (setSize * -1) + 1
		player.PlayerGui.PlayerStats.JetpackFuel.Backdrop.FuelLevel.Size = UDim2.new(1,0,setSize,0)
		player.PlayerGui.PlayerStats.JetpackFuel.Backdrop.FuelLevel.Position = UDim2.new(0,0,setPos,0)
		
		---- Boost Them Into The Sky
		hrp.AssemblyLinearVelocity = Vector3.new(hrp.AssemblyLinearVelocity.X,hrp.AssemblyLinearVelocity.Y + 1000,hrp.AssemblyLinearVelocity.Z)
	end
	wait(0.1)
end

And a video:

Have you tried making all the parts Massless in your Properties?

Not knowledgeable on this but this is just a wild guess.

1 Like

I don’t know what could possibly be going on, I have tried everything and have yet to find a solution.
Thanks for the help,
-PandaDev

_G.jetpack = {
flying = false;
fuel = 0;
fuelMax = 100;
fuelRegen = 5;
fuelRegenDelay = 5;
fuelRegenTimer = 0;
jetpack = script.Parent;
}

function jetpack.update()
if jetpack.flying then
jetpack.useFuel()
else
jetpack.regenFuel()
end
end

function jetpack.useFuel()
if jetpack.fuel > 0 then
jetpack.fuel = jetpack.fuel - 1
jetpack.jetpack.Parent.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(
jetpack.jetpack.Parent.HumanoidRootPart.AssemblyLinearVelocity.X,
jetpack.jetpack.Parent.HumanoidRootPart.AssemblyLinearVelocity.Y + 1000,
jetpack.jetpack.Parent.HumanoidRootPart.AssemblyLinearVelocity.Z
)
jetpack.renderFuel()
else
jetpack.stopFlying()
end
end

function jetpack.regenFuel()
if jetpack.fuel < jetpack.fuelMax then
local time = os.time()
if time >= jetpack.fuelRegenTimer then
jetpack.fuel = jetpack.fuel + jetpack.fuelRegen
if jetpack.fuel > jetpack.fuelMax then
jetpack.fuel = jetpack.fuelMax
end
jetpack.fuelRegenTimer = time + jetpack.fuelRegenDelay
jetpack.renderFuel()
end
end
end

function jetpack.renderFuel()
– Set the Gui To See Fuel Level
setSize = jetpack.fuel / jetpack.fuelMax
setPos = (setSize * -1) + 1
jetpack.jet