Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do you change CustomPhysicalProperties through script?

Asked by 5 years ago

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 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)

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. hkmag 0 — 5y
0
thank you for that, I was confused bc of that Noonekirby 162 — 5y
Ad

Answer this question