I'm having a nightmare issue with Unreal and gimbal lock screwing with rotation in 2D space. I have a turret with a cannon that follows the player, but when the player jumps over or is on one side vs the other of the turret, the cannon "flips" if utilizing all the axes or it will rotate the other direction if struct split. Does anyone have a solution that will work in 2D space? All the internet's solutions thus far only work in 3D space and don't take into account a "look at" function. I'm impartial on the fix being in C++ or Blueprints. Either will work, so long as there is a 2D fix.
I've tried the gimbal lock fix code by Nebula Games, various versions of set rotation, the add rotation that is claiming to fix it but only makes it worse, attempting to use Quaternions (which in Unreal I'm still learning about, but honestly don't know how to apply that in Unreal, C++ nor Blueprints) and a number of other crazy roundabout things and every single one does the same thing. Hits 90/-90 degrees and it flips/rotates the other direction.
Here's a screen of blueprints where it'll flip: cannon look at blueprints