Enabling CustomPhysicalProperties By Script

How do you Enable CustomPhysicalProperties with a script i already tried:
CustomPhysicalProperties = true
But it doesn’t work. How do I do this in a simple but efficient way

local cpp = script.Parent.CustomPhysicalProperties

ccp = true

local p = script.Parent.CustomPhysicalProperties.Density ---- Objects density

cuz this doesnt work

1 Like

BasePart.CustomPhysicalProperties (roblox.com)

1 Like

I’ve already read that post it doesnt explain how to Enable Custom Physical Properties

look at the code samples part.

I already looked at them but they dont enable anything

1 Like

Maybe you accidently anchored the part? Also try this:

local cpp = script.Parent

ccp.CustomPhysicalProperties = true

Edit: changing cpp does only change the variable, not CustomPhysicalProperties. And CustomPhysicalProperties can’t be a boolean. Try this:

local part = script.Parent

part.Anchored = false

local density = 0.7 --Put your number

local friction = 0.3

local elasticity = 0.5

local frictionWeight = 1

local elasticityWeight = 1

local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)

part.CustomPhysicalProperties = physProperties

Im not trying to change the properties i just need the objects mass

1 Like

If you need to get the objects mass you can call BasePart:GetMass() BasePart representing the part you want to get the mass of

yes but i need the density volume = mass/volume

To bring this back to life, this doesn’t seem to be working, once in game if you check the properties of the part, CustomPhysicalProperties is still unticked. Not to sure what is happening. You might have to enable it everywhere first? NVM, it is just you need to use all the properties, I am a idiot… NVM again, it simply does not show up whatever I do

I don’t know if it’s important anymore but I found a solution that works for me.

local part = script.Parent --Change to whatever part it is you're trying to change.

local density = 0.7 --Change
local elasticity = 0.5 --Change
local elasticityWeight = 1 --Change
local friction = 1 --Change
local frictionWeight = 3 --Change
		
part.CustomPhysicalProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)

Hopefully this helps somebody even though this topic is older than 2 years.
Here’s a link to my topic.

7 Likes

it helped thanks! it was looking and im sad* that somebody hasnt marked you as a solution.

1 Like