void Update ()
{
WFL.localEulerAngles.y = W_FL.steerAngle - WFL.localEulerAngles.z;
WFR.localEulerAngles.y= W_FR.steerAngle - WFR.localEulerAngles.z;
}
void Update ()
{
WFL.localEulerAngles.y = W_FL.steerAngle - WFL.localEulerAngles.z;
WFR.localEulerAngles.y= W_FR.steerAngle - WFR.localEulerAngles.z;
}
You can’t modify individual x/y/z components of vectors in Transforms. You have to set the whole vector at once, e.g. like this:
Vector3 oldWFLAngles = WFL.localEulerAngles;
WFL.localEulerAngles = new Vector3(
oldWFLAngles.x,
W_FL.steerAngle - oldWFLAngles.z,
oldWFLAngles.z);
EDIT: spread vector across multiple lines to make it more readable