I'm trying to modify the stiffness of my wheel(s) so I can remove friction from them when needed. Code (csharp): private void removeWheelFriction(){ foreach(WheelCollider wheel in wheels){ WheelFrictionCurve sf = wheel.sidewaysFriction; WheelFrictionCurve ff = wheel.forwardFriction; ff.stiffness = 0; sf.stiffness = 0; print("wheel"+wheel.sidewaysFriction.stiffness); } } Does not actually change the stiffness... it still comes through as the default value of 1. doing: Code (csharp): wheel.forwardFriction.stiffness = 0 returns and error that I cannot modify the return value because it is not a variable. How do I get this to work in c#?[/quote]
Never mind... I thought I had tried this already.. but this works: Code (csharp): private void removeWheelFriction(){ foreach(WheelCollider wheel in wheels){ WheelFrictionCurve sf = wheel.sidewaysFriction; WheelFrictionCurve ff = wheel.forwardFriction; ff.stiffness = 0; sf.stiffness = 0; wheel.forwardFriction = ff; wheel.sidewaysFriction = sf; print("wheel"+wheel.sidewaysFriction.stiffness); } }