From bcce0678c4adab31431146130eb7d6d0826b64dd Mon Sep 17 00:00:00 2001 From: moraaar Date: Mon, 22 Nov 2021 09:57:51 +0000 Subject: [PATCH] Fix collider component validation function by checking if the asset is ready (#5795) Signed-off-by: moraaar --- Gems/PhysX/Code/Source/EditorColliderComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp index 262e40cb99..7e1d1c341f 100644 --- a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp @@ -760,7 +760,7 @@ namespace PhysX if (asset == m_shapeConfiguration.m_physicsAsset.m_pxAsset) { m_shapeConfiguration.m_physicsAsset.m_pxAsset = asset; - m_shapeConfiguration.m_physicsAsset.m_configuration.m_asset = m_shapeConfiguration.m_physicsAsset.m_pxAsset; + m_shapeConfiguration.m_physicsAsset.m_configuration.m_asset = asset; UpdateMaterialSlotsFromMeshAsset(); CreateStaticEditorCollider(); @@ -785,7 +785,9 @@ namespace PhysX { const PhysX::EditorRigidBodyComponent* entityRigidbody = m_entity->FindComponent(); - if (m_shapeConfiguration.m_physicsAsset.m_pxAsset && (m_shapeConfiguration.m_shapeType == Physics::ShapeType::PhysicsAsset) && entityRigidbody) + if (entityRigidbody && + m_shapeConfiguration.m_shapeType == Physics::ShapeType::PhysicsAsset && + m_shapeConfiguration.m_physicsAsset.m_pxAsset.IsReady()) { AZStd::vector> shapes; Utils::GetShapesFromAsset(m_shapeConfiguration.m_physicsAsset.m_configuration, m_configuration, m_hasNonUniformScale,