- Home /
Question by
WalterEspinar · Jan 16, 2013 at 04:10 AM ·
wheelcollider
wheelCollider, change values by script
Hello, i need change some wheelcollider values, exactly the sidewaysFriction.extremumValue from default(20000) to 2000 by script, but i cant do work
col.suspensionSpring = js
col.radius = radius;
col.mass = WheelMass;
//this is i need change the value from 20000 default to 2000
col.sidewaysFriction.extremumValue
Comment
This will work:
WheelFrictionCurve wfc = col.sidewaysFriction;
wfc.extremumValue = 2000.0f;
col.sidewaysFriction = wfc;
Best Answer
Answer by Imankit · Jan 16, 2013 at 06:31 AM
You have to define the Wheel Collider first and then change its values.. Foe example :
public WheelCollider col; // Drag your wheel collider here in inspector
// In Update or your function :
col.sidewaysFriction.extremumValue = 2000;
col.mass = WheelMass;
col.suspensionSpring = js;
Hope it works..