of     1   

wolfman451
#170782416Tuesday, August 11, 2015 5:45 PM GMT

The following script makes everything weightless--cylinders, spheres, blocks, but for some reason does not affect wedges. What changes could be made so that they, too, are affected by the script? local Factor = 196.2 function AddGravity(Part) local Gravity = Part:findFirstChild("BodyForce") if Gravity ~= nil then return end local Gravity = Instance.new("BodyForce") Gravity.Parent = Part Gravity.force = Vector3.new(0,Factor * Part:GetMass(),0) end function GetClass(Root) if Root.className == "Part" or Root.className == "Seat" or Root.className == "SpawnLocation" or Root.className == "FlagStand" then AddGravity(Root) end local Parts = Root:GetChildren() for X = 1, # Parts do GetClass(Parts[X]) end Root.ChildAdded:connect(function(Child) GetClass(Child) end) end GetClass(script.Parent)
chimmihc
#170782917Tuesday, August 11, 2015 5:49 PM GMT

Change: "if Root.className == "Part" or Root.className == "Seat" or Root.className == "SpawnLocation" or Root.className == "FlagStand" then" to: "if Root:IsA("BasePart") then"
wolfman451
#170784311Tuesday, August 11, 2015 6:02 PM GMT

About to test it. Does this look correct? local Factor = 196.2 function AddGravity(Part) local Gravity = Part:findFirstChild("BodyForce") if Gravity ~= nil then return end local Gravity = Instance.new("BodyForce") Gravity.Parent = Part Gravity.force = Vector3.new(0,Factor * Part:GetMass(),0) end function GetClass(Root) if Root:IsA("BasePart") then AddGravity(Root) end local Parts = Root:GetChildren() for X = 1, # Parts do GetClass(Parts[X]) end Root.ChildAdded:connect(function(Child) GetClass(Child) end) end GetClass(script.Parent)
chimmihc
#170789664Tuesday, August 11, 2015 6:51 PM GMT

.

    of     1