How to change the wheel.forwardFriction.stiffness value?
Hello! I want to change the wheelCollider.forwardFriction.stiffness in a script, but I'm not getting it. How do I modify wheelCollider.forwardFriction.stiffness in a script? Please help me.
Answer by Bunny83 · Jul 13, 2019 at 11:20 AM
Just like you change any field of a struct that is provided through a property:
You store the struct value in a temporary variable
You change the field you're interested in on that temporary variable
You assign the temp variable back to the property
In code:
WheelFrictionCurve friction = wheelCollider.forwardFriction;
friction.stiffness = yourDesiredValue;
wheelCollider.forwardFriction = friction;
Your answer
Follow this Question
Related Questions
Is it possible to send information between to different scripts? 0 Answers
How do I take out a UI Slider's value? 0 Answers
How to put value on dropdown search like normal dropdown 0 Answers
Make a float variable change when another variable changes? 1 Answer
Tank controlling with wheel colliders?,Tank control on wheels? 0 Answers