3rd person character controller on planet: Can't get the player to look at given direction

I am creating a 3rd person controller in ECS, and my camera logic and player movement logic is separated. I want the player look in the direction the camera is facing when it starts moving, but I can’t get it to do that, I have tried everything and haven’t come up with a solution. here is my short code.

           angle += math.radians(input.mouseX * input.sensitivity); // Im adding onto angle's value because even if 
/// the player isn't moving I still want to recieve input and when the player does move they will be turned to what angle is set to

            if (input.moveInput != Vector2.zero) // If player is moving
            {
                rotation.Value = math.mul(rotation.Value, quaternion.Euler(0, angle, 0)); // if the player is moving turn // the player by angle
            }

And please remember that I NEED the angle to be saved so that when the player starts moving they don’t face the direction they were facing when they stopped moving(unless there wasn’t any input on mouse X after stopping)

A way I have thought of doing this is by creating a new rotation which isn’t rotated on the Y axis but only has rotations on its x and z axes that will give it the right planetary rotation, but I’m not sure how I can create a rotation like that, maybe I’m overthinking.

I saw a Brackeys tutorial on this once… I believe he did it by rotating the player’s existing rotation by a small amount each step, eg., the rotation to get you from point A to point B a very small distance away. That would preserve the heading of the player as they moved around the sphere. Google for his video on it, it might give you some clues.