diff --git a/Source/VesselModuleRotationRO.cs b/Source/VesselModuleRotationRO.cs index 9bea778e3b..9a5d315246 100644 --- a/Source/VesselModuleRotationRO.cs +++ b/Source/VesselModuleRotationRO.cs @@ -138,11 +138,13 @@ public void SetPosRot(Quaternion rotation, Vector3 position) return; } - List parts = vessel.parts; - for (int i = parts.Count; i-- > 0;) + var parts = vessel.parts; + // Have to iterate forwards to preserve hierarchy + int c = parts.Count; + for (int i = 0; i < c; ++i) { Part part = parts[i]; - part.transform.SetPositionAndRotation(position + rotation * part.orgPos, rotation * part.orgRot); + part.partTransform.SetPositionAndRotation(position + rotation * part.orgPos, rotation * part.orgRot); } }