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

how do you change CustomPhysicalProperties through script?

I have my part set to choose a random material and I can control what happens with each material(fabric makes you jump higher, i.e) but I wanted to set ice to be slippery using CustomPhysicalProperties. however, when I did, the output displayed this: PhysicalProperties.Friction cannot be assigned to

here is my code 'FloorPeice.CustomPhysicalProperties.Friction = -1 print(FloorPeice.CustomPhysicalProperties.Friction) FloorPeice.CustomPhysicalProperties.FrictionWeight = 100 print(FloorPeice.CustomPhysicalProperties.FrictionWeight)'

1 comment

1 answer

I've found it out! instead of

FloorPeice.CustomPhysicalProperties.Friction = -1 print(FloorPeice.CustomPhysicalProperties.Friction) FloorPeice.CustomPhysicalProperties.FrictionWeight = 100 print(FloorPeice.CustomPhysicalProperties.FrictionWeight)

its FloorPeice.CustomPhysicalProperties = PhysicalProperties.new(1.922, -1, 0.15, 100, 1) because part.CustomPhysicalProperties = PhysicalProperties.new(Density, Friction, Elasticity, FrictionWeight, ElasticityWeight)

2 comments

0

Just fyi, physical properties cant be negative. Lowest it can go is 0 and if you try to go lower it will automatically change to 0.

0

thank you for that, I was confused bc of that

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