CharacterController.Move problem with pause menu

When I pause my game I get that warning popping up. I don’t know if it’s even worth fixing as the game itself works fine. Here’s my code (that matters):

    if (Input.GetKeyDown(KeyCode.Escape))
    		if (pauseMenuOpen == false)
    			playerPosX = player.transform.position.x;
    			playerPosY = player.transform.position.y-.4;
    			playerPosZ = player.transform.position.z;
    			pauseMenuOpen = true;
function OpenPauseMenu () {

    player.GetComponent(CharacterController).enabled = false;
        Time.timeScale = 0;
        Screen.lockCursor = false;
        player.transform.position = Vector3(playerPosX, playerPosY, playerPosZ);

If i don’t turn off the character controller and the player is moving and pauses the game it returns null values for some variables and nothing seems to fix it. The “playerPosX” variables are used to set the position of the player because unity seems to lose track of the object and assigns it a y position than what it was previously at when i turn off the character controller.

If anyone knows how to fix the CharacterController.Move called on inactive controller
UnityEngine.CharacterController:Move(Vector3) problem without completely reworking my code it would be greatly appreciated. If there is no solution, is it bad to have the constant warnings like it’s giving me?


If the Character Motor is where the move is being called maybe try disabling the script when you are paused?
GetComponent().enabled = false;

Fixed it, problem was I had a script that was active that depended on the Character Motor so it would always re enable itself for anyone who might look at this in the future. Check your scripts