At the end of development, I tried to solve this problem, but there was no time left (there are still fragments in the logic responsible for opening doors, but they did not work correctly).