Fix collider component validation function by checking if the asset is ready (#5795)

Signed-off-by: moraaar <moraaar@amazon.com>
monroegm-disable-blank-issue-2
moraaar 4 years ago committed by GitHub
parent 5145fceedc
commit bcce0678c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -760,7 +760,7 @@ namespace PhysX
if (asset == m_shapeConfiguration.m_physicsAsset.m_pxAsset) if (asset == m_shapeConfiguration.m_physicsAsset.m_pxAsset)
{ {
m_shapeConfiguration.m_physicsAsset.m_pxAsset = asset; 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(); UpdateMaterialSlotsFromMeshAsset();
CreateStaticEditorCollider(); CreateStaticEditorCollider();
@ -785,7 +785,9 @@ namespace PhysX
{ {
const PhysX::EditorRigidBodyComponent* entityRigidbody = m_entity->FindComponent<PhysX::EditorRigidBodyComponent>(); const PhysX::EditorRigidBodyComponent* entityRigidbody = m_entity->FindComponent<PhysX::EditorRigidBodyComponent>();
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<AZStd::shared_ptr<Physics::Shape>> shapes; AZStd::vector<AZStd::shared_ptr<Physics::Shape>> shapes;
Utils::GetShapesFromAsset(m_shapeConfiguration.m_physicsAsset.m_configuration, m_configuration, m_hasNonUniformScale, Utils::GetShapesFromAsset(m_shapeConfiguration.m_physicsAsset.m_configuration, m_configuration, m_hasNonUniformScale,

Loading…
Cancel
Save