move joints before rigidbodies

This commit is contained in:
mischa 2024-01-24 15:53:30 +01:00
parent 5fab4c7978
commit 7b4a094f5c

View File

@ -368,9 +368,11 @@ public static void MoveAllJoints(GameObject source, GameObject destination)
// move all physics components from one GameObject to another. // move all physics components from one GameObject to another.
public static void MovePhysicsComponents(GameObject source, GameObject destination) public static void MovePhysicsComponents(GameObject source, GameObject destination)
{ {
MoveRigidbody(source, destination); // need to move joints first, otherwise we might see:
MoveAllColliders(source, destination); // 'can't move Rigidbody because a Joint depends on it'
MoveAllJoints(source, destination); MoveAllJoints(source, destination);
MoveAllColliders(source, destination);
MoveRigidbody(source, destination);
} }
} }
} }