Unity Animator cursor remains locked after animation

Hello there,

got a problem that i can’t understand, i made a very simple animation of the camera rotating simulating a head rotation, when the animation of the camera (child of the player object) is done playing, the camera is locked and doesn’t move at all, even if movement on WASD is working, i tried animation with moving the player object and camera, tried scripting to unlock the cursos and still doesn’t work, tried to destroy Animatorafter the animation and that handles the problem (but that’s not even an option)

Also the Animator has an idle position and doesn’t work even in idle if the animation clip is present in the Animator(even if not used at all and not connected). Asking for advices or help, thanks.

The camera control script looks like this:

using System.Collections;
using UnityEngine;

public class CameraControl : MonoBehaviour
{
    public Camera playerCamera;
    public float zoomFOV = 30.0f;
    public float normalFOV = 60.0f;
    public float zoomSpeed = 10.0f;
    public float lookSpeed = 2.0f;
    public float smoothTime = 0.1f;

    private bool isZooming = false;
    private bool controlsEnabled = true;
    private KeyRebindingManager keyRebindingManager;
    private float xRotation = 0f;
    private Vector2 currentMouseDelta;
    private Vector2 currentMouseDeltaVelocity;

    void Start()
    {
        if (playerCamera == null)
        {
            playerCamera = Camera.main;
        }
        playerCamera.fieldOfView = normalFOV;

        keyRebindingManager = FindObjectOfType<KeyRebindingManager>();
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
    }

    void Update()
    {
        if (!controlsEnabled) return;


        if (Input.GetKeyDown(keyRebindingManager.GetKeyForAction("Zoom")))
        {
            isZooming = true;
        }
        if (Input.GetKeyUp(keyRebindingManager.GetKeyForAction("Zoom")))
        {
            isZooming = false;
        }

        if (isZooming)
        {
            playerCamera.fieldOfView = Mathf.Lerp(playerCamera.fieldOfView, zoomFOV, Time.deltaTime * zoomSpeed);
        }
        else
        {
            playerCamera.fieldOfView = Mathf.Lerp(playerCamera.fieldOfView, normalFOV, Time.deltaTime * zoomSpeed);
        }

        Vector2 targetMouseDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
        currentMouseDelta = Vector2.SmoothDamp(currentMouseDelta, targetMouseDelta, ref currentMouseDeltaVelocity, smoothTime);

        float mouseX = currentMouseDelta.x * lookSpeed;
        float mouseY = currentMouseDelta.y * lookSpeed;

        transform.parent.Rotate(Vector3.up * mouseX);

        xRotation -= mouseY;
        xRotation = Mathf.Clamp(xRotation, -90f, 90f);

        transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
    }

    public void EnableControls(bool enable)
    {
        controlsEnabled = enable;
        Cursor.lockState = enable ? CursorLockMode.Locked : CursorLockMode.None;
        Cursor.visible = !enable;
    }
}