Help with creating a jetpack?

Im creating a jetpack that will rotate the player 90 degrees so they face down, then have a bodyvelocity push them forward, however I seem to have one major issue.

I need the character to still be able to rotate themselves on the y axis while in flight.
the players character will try to resist when I rotate them via bodygyro.
I tried enabling platformstand but this means the character wont be able to be controlled.

I thought about assigning a keybind to have them rotate but what if the user has a mobile device, it would seem to be simpler and easier to preserve player control instead of using this method.

what should I do? here is my current progress:

local mode = "Hover"
local stabilizer
local thruster
local jetpack
local tool = script.Parent

function changes()
	if tool.Parent and tool.Parent.PrimaryPart then
		
		
		if mode == "Hover" and stabilizer == nil and thruster == nil then
		stabilizer = Instance.new("BodyGyro")
		stabilizer.Parent = tool.Parent.PrimaryPart
		stabilizer.MaxTorque = Vector3.new(100000,0,100000)
		
		thruster = Instance.new("BodyVelocity")
		thruster.Parent = tool.Parent.PrimaryPart
		thruster.MaxForce = Vector3.new(0,40000,0)
		thruster.Velocity = Vector3.new(0,-5,0)
		end
		
		
		if mode == "Boost" and thruster ~= nil then
			thruster.Velocity = Vector3.new(0,15,0)
		end
		
		
		if mode == "Glide" and stabilizer ~= nil and thruster ~= nil then
			tool.Parent.Humanoid.PlatformStand = true
			stabilizer.MaxTorque = Vector3.new(100000000,100000000,0)
			stabilizer.CFrame = tool.Parent.PrimaryPart.CFrame * CFrame.Angles(math.rad(-90),0,0)
			wait(1)
			thruster.MaxForce = Vector3.new(40000,40000,40000)
			thruster.Velocity = tool.Parent.PrimaryPart.CFrame.UpVector * 30
		end
		
		
		
	end


script.Parent.Activated:Connect(function()
	if mode == "Hover" then
	mode = "Boost"
	changes()
	elseif mode == "Boost" then
		mode = "Glide"
		changes()
	elseif mode == "Glide" then
		mode = "Hover"
		changes()
	end
end)


script.Parent.Equipped:Connect(function()
	mode = "Hover"
	changes()
end)


script.Parent.Unequipped:Connect(function()
	
end)

I would suggest taking a look at VectorForce to make sure you are doing this correct.

BodyVelocity has the .MaxForce property. You can change the Y axis to 0 so that it doesn’t turn the player while they fly.

removing force on the Y axis causes the player to fall.

Sorry, I meant on the BodyGyro, or whatever you’re using to rotate them.
Which I see you’re already doing.

can the player even still rotate themselves when they are facing down? is there a point were the player cant rotate anymore when being tilted down?

also, I tried turning platform stand off and on but the results are the same, the player refuses to be tilted by the bodygyro when its false, and theres no control when its true.

1 Like

I mean, if they have shiftlock on it will rotate them, or if you lock the mouse it should do the same?
You could always code it so that they rotate based off the Delta of the mouse moving.

1 Like

its definitely helping, but I noticed something really strange, the primarypart of the character is set to the head for some reason, isnt it supposed to always be the humanoidrootpart? or is that just humanoid rigs from the plugin?

edit, also, with the current settings the bodygyro starts to drift a bit on one axis, what settings should I use to fix this?

I noticed this too, I think they might have changed the PrimaryPart a little while back.

If you’re going to be changing the BodyGyro to rotate the character with their mouse, you could set the BodyGyro to have some force on the other axes and update the BodyGyro. Otherwise, setting the force on those axes will just make it hold at that one rotation.

so I messed around and the only thing I can come up with is to use the default gyro setup, but instead make two parts, one to angle the character upward, and another to angle them downward, this should be fine since Im going to add an acual jetpack for visuals.