Fix crash when deleting collision data.

This commit is contained in:
Chandler Cox
2025-10-12 17:04:40 -05:00
parent f7b306532b
commit b62f331b08

View File

@@ -244,10 +244,14 @@ void Collider::UpdateGeometry()
if (actor)
{
const auto rigidBody = dynamic_cast<RigidBody*>(GetParent());
if (_staticActor != nullptr || (rigidBody && CanAttach(rigidBody)))
if (rigidBody && CanAttach(rigidBody))
{
Attach(rigidBody);
}
else if (_staticActor != nullptr)
{
PhysicsBackend::AttachShape(_shape, actor);
}
else
{
// Be static triangle mesh