FPSController rotation and mouse position question

Hello.

I made a series of scripts which rotate both the FPSController and its Camera to specific angles.
To give you an idea of how it looks, here are the main parts of the rotation scripts:

    public float rotationGoalx = 0f;
    public float rotationGoaly = 0f;
    public float rotationGoalz = 0f;


            Quaternion targetRotation = Quaternion.Euler(rotationGoalx, rotationGoaly, rotationGoalz);
            transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotation, smooth * Time.deltaTime);

There are 2 of these rotation scripts - one attached to the FPSController and one to the Camera, and then there’s a clickable GameObject with a script that, when the object is clicked, activates the rotation.
I realized that as long as player control is enabled, it won’t do anything, so I added a line on the GameObject that disables it while the FPSController is being rotated:
playerControl.GetComponent().enabled = false;

However, once the player control is given back (Set to True), the camera just snaps back to where the player was looking initially. I tried to lock mouse cursor with “Cursor.lockState = CursorLockMode.Locked;”, thinking that might help, but it didn’t.

So my question is: Is there a way to have the camera angle stay at the destination rotation when player control is given back?

For example: Player clicks on a door which starts an event where the character says something about needing a key, so he turns around.

Thank you

When you switch control back, just set the camera’s rotation to match the player’s rotation.

Also, you’re not using lerp correctly.