I know how to do it to a part but how do I do it to a model..?
function GetMassOfModel(model) local mass = 0 for i, v in pairs(model:GetChildren()) do if v:IsA('BasePart') or v:IsA('Union') then mass = mass + v:GetMass() end end return mass end
Something like that; When this function is called on a model (as the argument), it iterates through each object in the model specified, checks if it's a physical object, and then adds that object's mass into a total (the mass variable), returning the variable when it's done iterating.