Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how can you turn on CustomPhysicalProperties using a script?

I want to edit the CustomPhysicalProperties of the character when the player joins, but I need to enable it first, and I can't find the way to without using a custom character. Edit: sorry i meant i wanted to print the density


script.Parent.CustomPhysicalProperties = true
script.Parent.CustomPhysicalProperties.Enabled = true
script.Parent.CustomPhysicalProperties.Disabled = false
script.Parent.CustomPhysicalProperties.Value = true

1 answer

✓ Accepted answer

You must provide a PhysicalProperties type value as seen in the wiki page:


local part = script.Parent
 
-- The properties to set
-- This will make the part light and bouncy!
local density = .3
local friction = .1
local elasticity = 1
local frictionWeight = 1
local elasticityWeight = 1
 
-- Construct new PhysicalProperties and set
local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
part.CustomPhysicalProperties = physProperties

3 comments

0

Huh that's odd, i tried to print the density but it wouldn't let me. Is there anyway I can do that?

0

Edit:sorry I meant i wanted to get the density, my bad

0

and now it works, odd. Thanks anyways!

This discussion is preserved as it was. New answers, comments, and votes are closed.