Skip to content

Commit

Permalink
Fix patching script for RB-less MassProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipAlg committed Jan 23, 2025
1 parent b4fd0f4 commit e7afbbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Editor/AGXUnityEditor/PatchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit e7afbbb

Please sign in to comment.