Hello everyone!
I’m not very good at c# jet, I try to set the frequency and damping ratio on my obejct using a script with this:
foreach (Component bone in bones)
{
WheelJoint2D temp3 = bone.gameObject.AddComponent(typeof(WheelJoint2D)) as WheelJoint2D;
bone.gameObject.GetComponent<WheelJoint2D>().suspension.frequency = 1f;
}
But it says: “Cannot modify the return value of ‘WheelJoint2D.suspension’ because it is not a variable”.
How am I suppose to modify it then? It doesn’t have a setter either, what is this c# blackmagic?
Wisy you all a lovely day!