How can I avoid Gimbal Lock with Rotations?

HI! this is a really good tutorial but im my case i cant use actor local rotation due to some other conditions affecting the mesh! is there a way to get the code modified to “add actor world rotation” with quaternions! (i tried using “Set actor world rotation(Quaternion)” but it didnt helped!)

@Thumper Thank you for this post!
I don’t think I understand this enough to solve my case, though based on the way that you solved it, could you please help me?

I have a planet and a hand that is grabbing it, and rotates the camera. I’ve made this work up to a point where if I click towards the Z axis (pole), it will rotate the whole thing 180 degrees. Here is a picture of the nodes and an in-game view


For anyone with similar issues, I found a solution.
This is the math for grabbing something and rotating the camera around it. You need to have a parent for real time rotation, and on release transfer the rotation to 1 child lower in the hierarchy, then reset rotation to the parent like "Real time billboard → “Rotation paste billboard” → Camera+Hand

(e.g. while grabbing, rotate parent billboard caller “real time billboard” then on release, paste rotation to 'real time billboard’s child called “Rotation pasting billboard”. Then reset Real time billboard’s rotation to 0.0.0


image