I am trying to make a skydiving system. I have the skydiving animations but what I need help with most is slowing the character. I have already added a vector force that simply creates a somewhat accurate air resistance simulation. However, the player still speeds up over time, how could I add a max value to linear velocity?
I’m not 100% certain, but I believe i remember that one of the physics attachments that you can add to an object might be able to slow it down. I would suggest looking into some of the physics constraints you can attach to an object, that would be your best bet imo
Just a thought what if you increased gravity using the workspace and if that affects players unwantedly then maybe change the gravity in a local script?
I’ve done something similar to this but with a ball in order to create friction, and essentially all I did was use a vector force as well and apply a negative force to slow it down completely, but i’m assuming he wants to keep falling at a terminal velocity.
edit:
Found this in another post,
“Realistically, the only way you could simulate terminal velocity in Roblox is by using a logarithmic function which slowly decreases the acceleration until it reaches 0.”
Not necessarily 0 gravity just reduced gravity might help. But then again I despise roblox physics as I can never truly understand them.
i agree, roblox physics are not the most consistent or reliable. I have never tested how changing gravity in a local script will affect the rest of the server
It would probably be best if I found out how to max out the linear velocity, any ideas on that?
I think I got it all figured out, I am just adding to a vector force in the players HumanoidRootPart.
local Game = game
local Workspace = workspace
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid")
local RootPart = Humanoid.RootPart or Humanoid:GetPropertyChangedSignal("RootPart"):Wait()
if not RootPart then RootPart = Humanoid.RootPart end
local Mass = 0
for _, Descendant in ipairs(Character:GetDescendants()) do
if not (Descendant:IsA("BasePart")) then continue end
Mass += Descendant:GetMass()
end
local BodyForce = Instance.new("BodyForce")
BodyForce.Force = Vector3.new(0, Mass / 2 * Workspace.Gravity, 0)
BodyForce.Parent = RootPart
Increase/decrease ‘2’ in the body force’s force calculation if you want to decrease/increase respectively the effect of gravity on the player’s character.
All of above body movers are deprecated , roblox doesn’t suggest using them so any new-readers of this topic shouldn’t use them . I think VectorForce attachment could be better solution.
Great idea! But instead the script does some math to find out how fast the player is moving and decreases the velocity over time. I don’t feel like explaining it to far but basically I am applying changes to the Humanoid Root Part velocity, if you are wondering here is what it would look like:
Character.HumanoidRootPart.Velocity = Vector3.new(x, y, z) -- Of course I added some math in there ;)
this video video will show you how to apply a force onto the character using VectorForce
it will also show you how to add drag when falling so the character will hit terminal velocity
and it also shows you how to use the characters mass to push the character up so that gravity has not effect on the character