diff --git a/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp b/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp index f61f3e42..8f05f96f 100644 --- a/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp +++ b/SHADE_Engine/src/Math/Transform/SHTransformSystem.cpp @@ -66,17 +66,8 @@ namespace SHADE for (const auto* child : node->GetChildren()) { - // Active states of entities should sync with scene nodes - const bool IS_NODE_ACTIVE = child->IsActive(); - - #ifdef _DEBUG - const bool IS_ENTITY_ACTIVE = SHEntityManager::GetEntityByID(child->GetEntityID())->GetActive(); - SHASSERT(IS_NODE_ACTIVE == IS_ENTITY_ACTIVE, "Entity and Node active states are not synced!") - #endif - - // Anything below is inactive - if (!IS_NODE_ACTIVE) - break; + + const bool HAS_TRANSFORM = SHComponentManager::HasComponent(child->GetEntityID()); if (!HAS_TRANSFORM) @@ -84,8 +75,13 @@ namespace SHADE auto* childTransform = SHComponentManager::GetComponent(child->GetEntityID()); - if (childTransform->dirty || HAS_PARENT_CHANGED) - UpdateTransform(*childTransform, NODE_TRANSFORM); + // Only update if node in hierarchy and component are both active + const bool IS_NODE_ACTIVE = child->IsActive(); + if (IS_NODE_ACTIVE && childTransform->isActive) + { + if (childTransform->dirty || HAS_PARENT_CHANGED) + UpdateTransform(*childTransform, NODE_TRANSFORM); + } UpdateEntity(child);