Do you pick up the key by walking over it? If so, then on player overlap key set door open; door open could be a boolean variable on the door; door.open=true. If you are picking up with mouse click or touch, then on key touched/clicked, set door.open=true. Then you have an event, player can only advance or door will only work if door.open=true.