From e7afbbb4c1fed2c6cdfdcab088bbea515815706d Mon Sep 17 00:00:00 2001 From: Filip Henningsson Date: Thu, 23 Jan 2025 09:17:24 +0100 Subject: [PATCH] Fix patching script for RB-less MassProperties --- Editor/AGXUnityEditor/PatchHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/AGXUnityEditor/PatchHelper.cs b/Editor/AGXUnityEditor/PatchHelper.cs index ea319ca8..374b5fc7 100644 --- a/Editor/AGXUnityEditor/PatchHelper.cs +++ b/Editor/AGXUnityEditor/PatchHelper.cs @@ -228,7 +228,7 @@ private static void MigrateMassProperties( AGXUnity.Deprecated.MassProperties ol { if ( oldMP != null ) { var rb = oldMP.RigidBody; - if ( !ShouldPatch ) return; + if ( rb == null || !ShouldPatch ) return; CopyDefaultAndUserValue( oldMP.Mass, rb.MassProperties.Mass ); CopyDefaultAndUserValue( oldMP.InertiaDiagonal, rb.MassProperties.InertiaDiagonal ); CopyDefaultAndUserValue( oldMP.InertiaOffDiagonal, rb.MassProperties.InertiaOffDiagonal );