Custom part gravity module

Hey! I have recently been working on a Module that lets users set the gravity of parts.

Implementation Code

local gravity_module = require(game:GetService("ReplicatedStorage").GravityModule)
-- to set gravity gravity_module.SetGravity(table, gravity)
-- table ex. {partA,partB,partC) Gravity (0 - 1000)


local part_group = workspace.PartGroup:GetChildren()
gravity_module.SetGravity(part_group,5)


workspace:GetPropertyChangedSignal("Gravity"):Connect(function()
	gravity_module.SetGravity(part_group,5)
	warn("Changed")
end)

Video of Gravity on 20
https://streamable.com/qcimuq

Video of Gravity on 5
https://streamable.com/8lbzgj


How could I improve upon this? What should I add? If needed, I can provide the module code.

3 Likes

Not really sure what kind of feedback you’re expecting but here are some random ideas:

  • a function to reset the gravity of a part or a group of parts
  • a function to get a part’s gravity
  • a function to get the average gravity of a group of parts (?)
2 Likes