BodyVelocity Issues

So im trying to make a jetpack but these 2 lines keep messing it up, I can make it so i can only fly on a horizontal axis but i want to make it so i can diagonally and etc.

These are the two Lines

--- One Axis Script
 BodyV.MaxForce = Vector3.new(0,math.huge,0)
 BodyV.Velocity = Vector3.new(0,1,0)

I get stuck in midair with this one

--- Stuck in mid-air script
 BodyV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
 BodyV.Velocity = Vector3.new(0,0,0) --- No matter what i change this too same problem 
1 Like

My Reply Button froze

This is possibly due to setting the MaxForce’s Z/X properties to a huge value? I’m not sure I understand here

BodyV.MaxForce = Vector3.new(0,math.huge,0)
BodyV.Velocity = Vector3.new(0,0,0)

Can’t you just do this?

How would you make it so if i look down i would follow. Because the script just keeps me on one axis

i guess you gotta do camera look vector and do some math to do what youre trying

here is a jetpack model i made long time ago maybe you can get what you want?

https://www.roblox.com/library/6560214845/Jetpack-best

You might need to get the CurrentCamera’s CFrame LookVector in a LocalScript (Probably through a loop inside a RunService Event using RenderStepped to detect every time the camera moves)

Thank you guys for all helping but im getting pretty tired and i need sleep I will be adding too this tomorrow on what i found out was the solution.

Set their body velocity’s velocity by offsetting the camera’s look vector relative to the player, which will get move them where the camera looks.

Pseudo code:

local speed = 35

bodyVelocity.Velocity = primaryPart.Position + camera.CFrame.LookVector * 35

If you want to limit the direction to only the Y axis, then simply multiply the look vector by
Vector3.new(0, 1, 0) which will cancel out the X and Z axis and leave the Y axis only.

local speed = 35

bodyVelocity.Velocity = primaryPart.Position + camera.CFrame.LookVector * Vector3.new(0, 1, 0) * 35

You can try using

 game.Workspace.CurrentCamera.CFrame:ToEulerAnglesXYZ()  

to get where ur camera is looking to.

I tried this a while ago but it never worked, if you want to move to dms i can share the whole script and see if you can help

Got discord?
Spy#0005 , I can explain further there.

Added you Discord name is pretty much the same name as here.