fix(Prediction): child colliders now have the correct layer too

This commit is contained in:
mischa 2024-01-24 13:34:55 +01:00
parent 3c3c5c56fd
commit 38129b7696

View File

@ -133,6 +133,11 @@ protected static GameObject CopyRelativeTransform(GameObject source, Transform s
child.transform.localPosition = sourceChild.localPosition;
child.transform.localRotation = sourceChild.localRotation;
child.transform.localScale = sourceChild.localScale;
// assign the same Layer for the physics copy.
// games may use a custom physics collision matrix, layer matters.
child.layer = sourceChild.layer;
return child;
}