How would I make a drone move upwards with physics?

  1. What do I want to achieve?
    I want to make an fpv drone game but do not know how to make the drone move upwards with physics

  2. What is the issue?
    I can’t figure out how I would go about making the drone move up while still being collidable and affected by physics.

  3. What solutions have I tried so far?
    I’ve tried adding an amount to the drone’s CFrame but it doesn’t keep you moving up, it only makes you go up for a little bit, and then the drone falls and bounces and starts over again. I’ve tried to use VectorForce but it slowly speeds up until going way too fast, and I looked into LinearVelocity but that would make it float from what I know.

Any suggestions will help!

Video (Sped up to lower file size):

I’ve solved the problem and am happy with the result! If you’re curious on how it turned out, here’s another post I have made regarding the result:

2 Likes

Have you looked into character controllers

1 Like

I haven’t looked into that much, but I believe it would be for like self-leveling drones, right? I might be wrong about that, but if it is, then it’s not what I’m looking for. I’m trying to make an acrobatic drone that can do flips and stuff. It will be easier to see what I mean once I can attach a video.

1 Like

ok lets see the video on the physics

1 Like

I added a video to show the problems and it kinda shows the rotation I’m using for the drone.

1 Like

How about making the drone a character custom model and implementing specifics functions for the drone like Q to make it fly up.You could combine raycasting and physics to detect the magnitude from the ground from the drone to keep it floating and linearvelocity to keep the drone constant when flying.

1 Like

That would work for a drone, but not for the type of drone I’m trying to achieve. This video shows what I mean: https://youtu.be/I_PoQCq4O9k?t=7
The drone would rotate on all axes, and the up and down movement would be based on the rotation of the drone (so that it’s going upwards depending on the drones rotation, like if im moving up and looking forwards, then I’ll go forwards)

1 Like

You can do this with either VectorForce or LinearVelocity constraints, the difference is in how you have to (or want to) write the control code.

With a LinearVelocity, you set the target velocity from code directly, and the constraint itself manages the forces required to attain that velocity. Basically, the constraint applies force every frame, up to the MaxForce you specify, to reach the target velocity. The flexibility you lose with this constraint is that you have no control over how much force is applied, apart from the maximum limit. That is to say, you’re leaving the acceleration rates up to Roblox, and the result is likely that the force applied will be just enough to reach the target speed as quickly as possible with practically no overshoot (i.e. a critically-damped approach).

With a VectorForce, you have total control over how much force is applied per frame, so you can make something that accelerates crazy fast but overshoots (underdamped) or you can make it slowly ramp up to speed with no overshoot (overdamped), or you can try for critically-damped with your own tuning. I’m not an FPV drone expert, so I don’t know what is typical for drones in each class, but I suspect that–at least with expensive ones–you probably have basically the same options; letting the controller solve the problem for the smoothest flight, or directly controlling throttle yourself like a rebel, camera stabilization be damned.

Whether you steer and stabilize with just one force constraint plus an orientation constraint, or whether you do it all with vectorforces (like one per propeller), is another matter. Both are viable, the latter being more of a low-level direct simulation, the former being more of an approximation of the end result (and computationally cheaper).

1 Like

Thanks for the explanations on the different constraints! I’m going to try to use LinearVelocity with speed gainage rather than just instant speed and disable it when you don’t have any throttle input so that you don’t just float when you aren’t controlling the drone. (It makes a part float like BodyVelocity, and I’m not sure if there is a fix to the floating other than turning off the constraint when you’re not using it). I’m busy at the moment, so I can’t do it right now, but I’ll get back on if it works once I can test it!

1 Like

Yeah, the constraint tries to maintain the target velocity on all enabled axes, even if that velocity is zero. So you have to either disable it (cheapest), or set MaxForce to zero if you want the drone to freefall.

2 Likes

I tried the method I thought of, but it didn’t work because if you go slow then you aren’t effected by gravity, which makes it unrealistic. I did however find a solution! I decided to try VectorForces again, and I found this post to add a speed cap to an object:

I modified it a tiny bit and made it only run while the drone has a throttle input, and it worked!