From 9f8c80179564307b3a023a5ec06452617000b85c Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 24 Jan 2024 14:48:22 +0100 Subject: [PATCH] Prediction: collider materials are now copied too --- .../Mirror/Components/PredictedRigidbody/PredictionUtils.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Mirror/Components/PredictedRigidbody/PredictionUtils.cs b/Assets/Mirror/Components/PredictedRigidbody/PredictionUtils.cs index da0772674..52fd2210a 100644 --- a/Assets/Mirror/Components/PredictedRigidbody/PredictionUtils.cs +++ b/Assets/Mirror/Components/PredictedRigidbody/PredictionUtils.cs @@ -73,6 +73,7 @@ public static void MoveBoxColliders(GameObject source, GameObject destination) colliderCopy.center = sourceCollider.center; colliderCopy.size = sourceCollider.size; colliderCopy.isTrigger = sourceCollider.isTrigger; + colliderCopy.material = sourceCollider.material; GameObject.Destroy(sourceCollider); } } @@ -92,6 +93,7 @@ public static void MoveSphereColliders(GameObject source, GameObject destination colliderCopy.center = sourceCollider.center; colliderCopy.radius = sourceCollider.radius; colliderCopy.isTrigger = sourceCollider.isTrigger; + colliderCopy.material = sourceCollider.material; GameObject.Destroy(sourceCollider); } } @@ -113,6 +115,7 @@ public static void MoveCapsuleColliders(GameObject source, GameObject destinatio colliderCopy.height = sourceCollider.height; colliderCopy.direction = sourceCollider.direction; colliderCopy.isTrigger = sourceCollider.isTrigger; + colliderCopy.material = sourceCollider.material; GameObject.Destroy(sourceCollider); } } @@ -132,6 +135,7 @@ public static void MoveMeshColliders(GameObject source, GameObject destination) colliderCopy.sharedMesh = sourceCollider.sharedMesh; colliderCopy.convex = sourceCollider.convex; colliderCopy.isTrigger = sourceCollider.isTrigger; + colliderCopy.material = sourceCollider.material; GameObject.Destroy(sourceCollider); } }