X Axis Rotation Not Following Characters Relative Rotation Upon Moving Up and Down

This BP setup is for moving my character up when pressing ‘space’. I am facing the issue that the x axis rotation doesn’t follow the characters relative rotation and snaps back to what I assume is the world rotation when I press ‘space’. I’ve been trying and testing nodes to fix this but can’t find a solution. Any help with this?

Here’s an image of my BP setup and video link to what’s happening in Realtime.

Hi and welcome. It happens because you exactly tell your character to do so - Set Actor Rotation sets all those 3 values, even if you changed just one, so X and Z are always set to 0.
Try using AddActorLocalRotation, so it it will only change the axis that you want to update. You will need to rework your angle calculation slightly.