I’m working on a fighting game and one of the abilities for my characters is they have a slow fall speed and I know in studio you can change the gravity of your game which effects everyone and there doesn’t seem to be a gravity option for humanoids (their should be though :() so how can I effect a characters fall speed?
You can create a vectorforce on a character and make it’s force enough to counter gravity:
Put a vectorforce with an attachment in the HumanoidRootPart of the player, make sure to have ApplyAtCenterOfMass true, RelativeTo set to world, and set the vectorforce’s force like this:
local Antigrav = 5
function GetMasses()
local total = 0
for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
if v:IsA("BasePart") then
total = total + v.Mass
end
end
return total
end
VectorForce.Force = Vector3.new(0,GetMasses() * (workspace.Gravity/Antigrav), 0)
This makes the character have a 5th of the normal gravity.
I’m a bit confused with how to do this so I make a VectorForce with Instance.new and an Attachment with Instance.new and parent it to the VectorForce? And then I parent the VectorForce it to the HumanoidRootPart? Also how do I set the RelativeTo I tried looking it up and found literally nothing on how to use it.
The attachment must be parented to the humanoidrootpart, non basepart parents won’t work. Set relativeTo with VectorForce.RelativeTo = “World”
VectorForce documentation
Attachment documentation