How get CustomPhysicalProperties data?

Hello. i’m making my game. for now I’m stuck with CustomPhysicalProperties, bc it throws error, when I trying use CustomPhysicalProperties.Density. Can someone tell me, how I should get that properties?

I don’t want change it, I want get Part’s properties like:

local part = workspace.part
local Density = part.CustomPhysicalProperties.Density -- this throws error

Enable “CustomPhysicalProperties” in part’s properties.

print(Instance.CustomPhysicalProperties)

This should work (not all ‘PhysicalProperties’ values share the same components).

https://developer.roblox.com/en-us/api-reference/datatype/PhysicalProperties

1 Like

I’m fairly sure CustomPhysicalProperties will be nil if they haven’t been modified. You can safely use this to just retrieve the Part’s material properties.

Switch out Plastic with your part’s material

PhysicalProperties.new(Enum.Material.Plastic) --> returns default physical values for Plastic
1 Like

This prints nil

The only possible solution for now.

Yes, I was informing you of how to avoid the error, of course you’d actually need to set a part’s ‘PhysicalProperties’ property in order for it to be not ‘nil’.