void Transform::SetParent(Transform * newParent) { if (newParent == nullptr || newParent == this) return; //TODO: test this function, circular dependency issues should be fixed, but only test on trying to set a transforms parrent to itself Transform* current = newParent; while(current->GetParent() != nullptr) { if (current == this) return; current = current->GetParent(); } parent = newParent; }