How can i move physical object in constrained fields

Hello. I’m currently working on Vr project and i need to do so that the door can be opened or closed with motion controllers.But problem is that the door must slide inside door rails that have different paths.
Any suggestions?
Please help!