# Wheels not facing right direction when car faces different directions

I am creating a real time multiplayer driving game in Unity. I am using google play's real time multiplayer service. I am having an issue where the wheels of the cars that are over the network are not facing the right direction. What I am currently trying to do is just add the calculated steering angle to the current rotation of that particular player's car, but for some reason the wheels face the wrong way and rotate incorrectly if the car is facing certain directions. Logically I thought what I have is correct. Basically for each wheel I use this code:

car.transform.rotation = Quaternion.Euler(0, car.transform.rotation.y + steerAngle, 0);


So I find the rotation of that car and then I add the steer angle to it. Why wouldn't this work?

Assuming the wheels are children of the car, it will be easier to apply steerAngle to transform.localRotation. The numbers you see in the transform's inspector are local, not world. By adjusting/transmitting the local rotation for the wheels, you can apply them directly and let the transform hierarchy worry about getting them to come out right in world-space. You can rest assured that the local rotation is always relative to the parent car.