How to avoid gimbal lock (c++)?

Arthur, do you have lag on the spring arm? The lag implementation does not support full 6DoF and you’ll have to update it to use quaternions instead of rotators, as well.

Your hybrid solution should work.

// Hybrid
     FRotator RotationDelta(CameraInput.Y * CameraRotationSpeed, 0.f, 0.f);
     FTransform Transform = CameraSpringArm->GetComponentTransform();
     FRotator Rotation = CameraSpringArm->GetComponentRotation();
     Rotation.Yaw += CameraInput.X * CameraRotationSpeed;
     Transform.SetRotation(Rotation.Quaternion());
     Transform.ConcatenateRotation(RotationDelta.Quaternion());
     Transform.NormalizeRotation();
     CameraSpringArm->SetWorldTransform(Transform);