Door Script isn't recognize bool in character script.

I am trying to make a door that should recognize if the player has taken up the key in the area. the key is a simple trigger collision makes a bool be true.

 void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.CompareTag("Key"))
            {
                other.gameObject.SetActive(false);
                hasKey = true;
                Debug.Log(hasKey);
            }
        }

while the door checks this script on its trigger.

void OnTriggerEnter()
    {
        if (RequiresKey == true)
        {
            if (_fpsCharacterController.hasKey == true)
            {
                if (onTriggerEnterParameterName != null)
                {
                    Debug.Log("You have the key");
                    animator.SetTrigger(onTriggerEnterParameterName);
                }
            }
            else if (_fpsCharacterController.hasKey == false)
            {
                Debug.Log("you don't have the key");
            }
        }
        else if (RequiresKey == false)
        {
            if (onTriggerEnterParameterName != null)
            {
                animator.SetTrigger(onTriggerEnterParameterName);
            }

        }

    }

The Bool is public and when i manually change it on the players prefab the door works, bur it doesn’t work when i take up the key in the game.

I think i figured it out. The script/gameObject that the door script is looking for is set to the default prefab in my assets which is set as hasKey = false, so i guess it doesn’t know how to see if the new player has a key.