In my game, I’m making a system which allows the player to pick up objects and drag them around by holding left click on the object. When doing this, I need to get the part’s mass so I can compensate for the part’s gravity.
This works perfectly fine until I weld 2 parts together, since the script is only getting the mass of the part which I’m clicking (not getting the mass of both parts combined)
Is there a way I can get a list of all parts welded to the part that the player is moving or is there another way to fix this problem?
Current script if it helps or if you want to edit it:
local GoalPosition = (char:WaitForChild("HumanoidRootPart").Position + Vector3.new(0, 1.5, 0)) + cam.CFrame.LookVector * 6
-- If you don't understand this, it just moves the part 6 studs in front of the camera
local ObjectMass = TargetObject:GetMass()
SelectionCursor.Velocity = ((GoalPosition - SelectionCursor.Position) + Vector3.new(0, ObjectMass, 0)) * 5
So there’s not really an easy way to do this? I figured it would be a lot easier if I didn’t have to manually write a script every time I weld a part together since it would make adding new things to the game a lot more difficult
I could make the part massless, but I would also need to make the welded parts massless too which I can’t really do if I can’t get a list of welded parts