Hello. I am creating a boat, after researching for a while, I figured out what decides whether an object will sink or not is it’s density, therefore, I assume if I don’t want an object to sink, I need to set it’s density to be equal to Roblox’s water density. So my question is, how do I get Roblox’s terrain water density, or is it impossible?
The density of water in Roblox is 1 - this can be found by setting a part’s Material to Water by inputting into the command line:
workspace.Part.Material = Enum.Material.Water
You can then check CustomPhysicalProperties on the part and check the density (which will have updated, and will now be set at 1. Same happens for other materials, even those which don’t really need a density (e.g. terrain basalt or the glacier material).
We can tell this is accurate by testing it, putting a 1x1x1 cube of material density 1 into water, which will then not move at all. If density is slightly increased, it starts sinking, and if decreased it will start to float above the water.
Note that a part with equal density won’t sink, but it also won’t float - it’ll remain in place in the water wherever you left it, or it’ll act as if it has no gravity if you push it. Any lower density will make it float.
Hope this helps!
Thanks for the comment! That helps a lot.