Hello so Im trying to make a button that changes the density of a part so that it will sink. Im doing this for my sub game. How should the scrip look like? I would be really grateful if someone could help me. thank you
You can modify density with CustomPhysicalProperties
local density = .3 local friction = .1 local elasticity = 1 local frictionWeight = 1 local elasticityWeight = 1 local function sink() local part = script.Parent local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight) part.CustomPhysicalProperties = physProperties end
All you would need to do is change settings at top and connect sink() to the GUI button down event
I got this from wiki: https://developer.roblox.com/en-us/api-reference/property/BasePart/CustomPhysicalProperties