You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I want to create a force that counteracts gravity whenever parachute is deployed. However, the gravity value can be changed at anytime. -
What is the issue?
If I were to use the default gravity value, the player would fall slower. However, if I use the value of gravity similar to the Moon, then the player moves up. -
What solutions have you tried so far?
I tried to use gravitational force calculation so that it adapts to changing gravity value. But it fails
local function deployPlayerParachute(Player)
print("Parachute Deployed")
local Character = Player.Character
local parachuteHeightOffset = 13
if Character then
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local Parachute = game.ReplicatedStorage:FindFirstChild("Parachute"):FindFirstChild("Parachute"):Clone()
Parachute:PivotTo(CFrame.new(HumanoidRootPart.Position + Vector3.new(0, parachuteHeightOffset, 0)))
local totalCharacterMass = getMassOfModel(Character)
local gravitationalForce = (totalCharacterMass * workspace.Gravity)
Parachute.Base.VectorForce.Force = Vector3.new(0, gravitationalForce, 0)
Parachute.Parent = Character
Parachute.Base.WeldConstraint.Part1 = HumanoidRootPart
ParachuteFeedbackRemoteEvent:FireClient(Player, true)
checkIfPlayerLandedWithParachute(Character)
end
end