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

PhysicalProperties.Friction cannot be assigned to?

Asked by 2 years ago

Hello everyone! I have a quick question about coding the friction property of a part. I want to change the friction of each tire every single time when it touches parts named Red, Yellow Blue and Pit, however when I test this in studio, it doesn't change the value. After that I noticed that ROBLOX had changed their friction property into CustomPhyiscalProperties so I added that before friction and it still didn't work. Do you have an idea's on how to fix this?

function onTouched(hit) if hit.Name == "Red" then script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction - .005 script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction - .005 script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction - .005 script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction - .005 else if hit.Name == "Yellow" then script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction - .007 script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction - .007 script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction - .007 script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction - .007 else if hit.Name == "Blue" then script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction - .009 script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction - .009 script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction - .009 script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction = script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction - .009 else if hit.Name == "Pit" then script.Parent.Parent.Tire1.CustomPhysicalProperties.Friction = 1 script.Parent.Parent.Tire2.CustomPhysicalProperties.Friction = 1 script.Parent.Parent.Tire3.CustomPhysicalProperties.Friction = 1 script.Parent.Parent.Tire4.CustomPhysicalProperties.Friction = 1 end end end end end script.Parent.Touched:connect(onTouched)

0
There's something in the back of my head which I'm not sure is true or not but, don't you need to enable CustomPhysicalProperties? Maybe having it disabled is causing that error. greatneil80 2647 — 2y

Answer this question