VAR_GRAV = 2
local bf = Instance.new("BodyForce",char.Torso)
bf.force = Vector3.new(0,196.2 * VAR_GRAV,0) * bf.Parent:GetMass()
Yeah, this is all fine and dandy. The code makes the character jump higher, but at the same time, it makes him fall slower, and that's a no-no. All this does is reduce gravity on the player, and that's not what I want.
What I want is a code that will allow the character to jump high while still maintaining the normal speed of falling down. Thanks in advance :>
--EDIT--
Work's like a charm :) Here's the script for those interested. It is local script that is located within the character's Torso.
wait()
local char = script.Parent.Parent
if (char:findFirstChild("Humanoid") == nil) then return print("Not a human") end
----------
-- DATA --
----------
VAR_GRAV = 2.5
---------------
-- FUNCTIONS --
---------------
function getCharMass()
local sum = 0
for _,v in pairs(char:GetChildren()) do
if v:IsA("Part") then
sum = sum + v:GetMass()
end
end
return sum
end
function createGrav()
if (char.Torso:findFirstChild("GravityForce") ~= nil) then char.Torso.GravityForce:Destroy() end
local bf = Instance.new("BodyForce",char.Torso)
bf.Name = "GravityForce"
bf.force = Vector3.new(0,196.2 * VAR_GRAV,0) * getCharMass()
wait()
bf:Destroy()
end
char.Humanoid.Jumping:connect(function(jump)
if (jump) then
createGrav()
end
end)
