Hello! So I am currently making a game where falling at the same speed overtime is critical.
It seems like when you fall in Roblox the fall speed accelerates overtime. I dont want this, I just want a linear fall speed where it stays the same and does not decelerate or accelerate as you fall.
If possible, I would also like the fall speed to increase by a certain value when the key ‘W’ is is held down, then when the key is unpressed the fall speed then returns to its original linear speed.
As you can tell I am very unexperienced with the gravity property and BodyVelocity etc. So if anyone could point me in the right direction that would be briliant.
You could try using HumanoidRootPart:GetPropertyChangedSignal("Velocity") and every time it changes do a check to see if the user is falling. If they are set their velocity. As for holding the W key to speed up, you could look towards UserInputService.
If you want to limit the speed that an object falls at, you can check the velocity every physics tick and keep it at an acceptable level.
-- local script in StarterCharacterScripts
local maxFallingSpeed = -30
local part = script.Parent.PrimaryPart -- the vertical velocity of this part shall not go lower than maxFallingSpeed
game:GetService("RunService").Stepped:Connect(function()
local v = part.Velocity
if v.Y < maxFallingSpeed then
part.Velocity = Vector3.new(v.X, math.max(maxFallingSpeed, v.Y), v.Z)
end
end)
The character will still have a parabolic arc to its jumps, as normal, but it won’t fall faster than 30 studs per second.
Hmm, not sure, maybe use a BodyVelocity like ElusiveEpix said, then make the MaxForce on Y as high as possible and add a negative Y velocity, the lower the velocity the higher the fall speed should be.