How can I make BodyVelocity abide by gravity? By this I mean if I had a part and I had BodyVelocity applied to it and I pointed the part straight up how could I realistically slow down the velocity and same in the other direction, so if I turned it straight down the velocity would speed up and make the part go faster. Similar to how the planes work in this game
I’ve tried using BodyForce to create a downward force but it just seems to not affect the velocity at all. I’m thinking I need to do some kind of calculations with the angle the part is facing but I don’t know how to make it realistic. Any suggestions would help!
2 Likes
What is your application where you need to set a velocity, but also want to have it affected by forces?
It might make sense to just use a BodyForce instead of a BodyVelocity (not both).
A bodyvelocity applies a velocity to a part, so it will always break the force / speed of gravity.
You need to instead apply a bodyforce / bodythrust to your 3D object to make it abide by the laws of gravity.
Also, these are legacy bodymovers and it’s actually a good idea to use a vectorforce, or something new like that to accomplish what your trying to accomplish.
Edit: And remember. Mass * workspace.Gravity
will be enough force to keep the part from falling down due to gravity, then if you apply slightly more force, it will start to accelerate upwards.
2 Likes
I’m not familiar with vectorforce, is it the same as BodyForce as in when you apply a force that is higher than Mass * workspace.Gravity
it will build up velocity and move very fast after only a few seconds? After some testing with BodyForce that seems to be what it does, if you put BodyForce on to a part and then do Mass * workspace.Gravity * 1.05
10 velocity is added onto the part every second which is not what I want.
Yes, it’s the same.
No it will stay in place, try moving the part up with the move tool while the force is being applied to it, and the part won’t fall down at all.
What you could do is if the velocity of a part is more than a certain value, than set the force to 0 until the velocity is lower than the limit.
You’d need to do this every physics or render frame however.
If vectorforce is anything like BodyForce then this is not what I’m looking for, after playing around with BodyForce for about an hour I ruled it out. What I’m actually trying to do is make a plane, the problem is it has a constant velocity regardless of the angle it’s pointing at which isn’t realistic. Depending on what angle the plane is on I want to add or subtract velocity from it. So if it’s pointing up subtract velocity and if it’s pointing down add velocity.
I’m just wondering if I can add a body mover to achieve this or do I need to do calculations to the BodyVelocity to achieve this effect, and if I do what would be the calculations to the most realistic approach? I have a few ideas in mind but they don’t seem very realistic.
1 Like
You could get the rotation of the plane so the more the plane is rotated up, the more you subtract from the main velocity.