How to trigger a door with an object not first person controller

Hello! I am very new to Unity and scripting, but I’m trying to make a game where the player finds an object and picks it up. The player then goes to a door (carrying the object) and the object triggers the door to open to finish the level. My problem is that I cannot figure out how to get the object to trigger the door open. I tried several different scripts, but only one of them worked and I’m too new to be able to fix the other ones. The one that worked is perfect, except that not only the object triggers the door but the first person controller, which means that at any point the player can walk up to the door and win the game, which defeats the purpose of playing it. Can anyone help me figure out a way to solve this problem?

Thanks!

Add a unique tag to the object (example ‘Key’), add a trigger to both the key and the door and then add a script to the door:

function OnTriggerEnter(item) {
    if(item.tag == "Key")
        OpenDoor();    
}

You have to either declare a OpenDoor() function, o replace OpenDoor() with whatever code you use, to actually open the door.